feat: use chrono NaiveDateTime
parent
d93311a4fb
commit
cb2df46a79
|
@ -16,7 +16,7 @@ pub enum NativeEventType {
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct NativeEvent {
|
pub struct NativeEvent {
|
||||||
pub time_sec: u64,
|
pub time_sec: i64,
|
||||||
pub time_nsec: u32,
|
pub time_nsec: u32,
|
||||||
pub event_type: NativeEventType,
|
pub event_type: NativeEventType,
|
||||||
pub vkey: u16,
|
pub vkey: u16,
|
||||||
|
@ -33,8 +33,9 @@ fn send_callback(ev: NativeEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_time(time: NaiveDateTime) -> usize {
|
|
||||||
time.timestamp_nanos() as usize
|
time.timestamp_nanos() as usize
|
||||||
|
fn get_time(time: NaiveDateTime) -> (i64, u32) {
|
||||||
|
(time.timestamp(), time.timestamp_subsec_nanos())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
Reference in New Issue