devela::_dep::nc::call

Function gettimeofday

pub unsafe fn gettimeofday(
    timeval: &mut timeval_t,
    tz: Option<&mut timezone_t>,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Get time.

§Examples

let mut tv = nc::timeval_t::default();
let mut tz = nc::timezone_t::default();
let ret = unsafe { nc::gettimeofday(&mut tv, Some(&mut tz)) };
assert!(ret.is_ok());
assert!(tv.tv_sec > 1611380386);