feat: use chrono NaiveDateTime

main
paring 2022-12-01 17:14:47 +09:00
parent f74f3894d7
commit c13b65c3ba
3 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
chrono = "0.4.23"
skyhook = { path = "./vendor/skyhook/skyhook" }
[lib]

View File

@ -1,9 +1,12 @@
use std::{
ffi::{c_char, CString},
ptr::null,
time::{SystemTime, UNIX_EPOCH},
time::UNIX_EPOCH,
};
use chrono::NaiveDateTime;
extern crate chrono;
extern crate skyhook;
#[repr(C)]
@ -30,8 +33,8 @@ fn send_callback(ev: NativeEvent) {
}
}
fn get_time(time: SystemTime) -> usize {
time.duration_since(UNIX_EPOCH).unwrap().as_nanos() as usize
fn get_time(time: NaiveDateTime) -> usize {
time.timestamp_nanos() as usize
}
#[no_mangle]

2
vendor/skyhook vendored

@ -1 +1 @@
Subproject commit 530166d47103698a2613e42b47f8c89a91c2363b
Subproject commit df9bf9ea7077b7c04f014e90a66924c1cf8629cb