feat: use chrono NaiveDateTime
parent
f74f3894d7
commit
c13b65c3ba
|
@ -4,6 +4,7 @@ version = "0.1.0"
|
|||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4.23"
|
||||
skyhook = { path = "./vendor/skyhook/skyhook" }
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 530166d47103698a2613e42b47f8c89a91c2363b
|
||||
Subproject commit df9bf9ea7077b7c04f014e90a66924c1cf8629cb
|
Reference in New Issue