devela::_dep::nc::call

Function clock_getres

pub unsafe fn clock_getres(
    which_clock: i32,
    tp: Option<&mut timespec_t>,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Get resolution(precision) of the specific clock.

§Examples

let mut tp = nc::timespec_t::default();
let ret = unsafe { nc::clock_getres(nc::CLOCK_BOOTTIME, Some(&mut tp)) };
assert!(ret.is_ok());
assert!(tp.tv_nsec > 0);