Skip to main content

nros_platform_clock_resolution_ns

Function nros_platform_clock_resolution_ns 

Source
pub unsafe extern "C" fn nros_platform_clock_resolution_ns() -> u64
Expand description

Granularity of nros_platform_clock_ns, in nanoseconds: the smallest non-zero difference two successive reads can report.

Examples: 1000000 for a 1 kHz tick, 40 for a 25 MHz cycle counter, 1000 for a microsecond hardware timer.

Must be non-zero, and constant for the lifetime of the program after platform init. A port whose underlying rate is only known at runtime returns the resolved value; one whose rate can change under it returns the COARSEST value it may exhibit. There is no “unknown” encoding — a port that cannot answer honestly is reporting a clock it cannot honestly offer.