#![allow(non_snake_case)]
use std::mem::zeroed;
pub fn Generic_gettime_realtime(tvp: &mut libc::timeval, msec: &mut u64) {
let mut ts: libc::timespec = unsafe { zeroed() };
if unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, &mut ts) } == 0 {
tvp.tv_sec = ts.tv_sec;
tvp.tv_usec = (ts.tv_nsec / 1000) as libc::suseconds_t;
*msec = (ts.tv_sec as u64 * 1000) + (ts.tv_nsec as u64 / 1_000_000);
} else {
*tvp = unsafe { zeroed() };
*msec = 0;
}
}
pub fn Generic_gettime_monotonic(msec: &mut u64) {
let mut ts: libc::timespec = unsafe { zeroed() };
if unsafe { libc::clock_gettime(libc::CLOCK_MONOTONIC, &mut ts) } == 0 {
*msec = (ts.tv_sec as u64 * 1000) + (ts.tv_nsec as u64 / 1_000_000);
} else {
*msec = 0;
}
}