cyg_clock_get_systime_res -- Obtain the resolution of the system clock


#include <cyg/clock/api.h>

Cyg_ErrNo cyg_clock_get_systime_res(struct timespec *ts);


This function can be called to obtain the resolution of the system clock. The resolution is expressed as the time difference (quantum) corresponding to the smallest increment the clock may make, in nanoseconds, and returned in the struct timespec pointed to by ts.

Due to rounding errors in calculations, and the possibly of a fine adjustment being in progress (if CYGFUN_CLOCK_COMMON_ADJTIME is enabled), it is not guaranteed that the difference between two sequential reads of system time will never be smaller than the resolution returned here.

Return value

This function returns a standard error code, as defined in <errno.h>, or ENOERR on success.

Documentation license for this page: eCosPro License