search for: nut_clock_timestamp

Displaying 1 result from an estimated 1 matches for "nut_clock_timestamp".

2012 Oct 16
2
nut_clock_* unit test ideas
...he methods I'd use are actually quite simple; for the timestamps difference (i.e. typical usage of the monotonic clock) validity checking, I'd simply use select with ho descriptors and a timeout. I'd take a timestamp before, after and compare the diff. with the timeout. In pseudo-code: nut_clock_timestamp(&ts); select(0, NULL, NULL, NULL, &to); diff = nut_clock_sec_since(&ts); ut_pass = abs((to.tv_sec + to.tv_usec / 1000000.0) - diff) < sigma; (Note that this pseudo-code doesn't include application of the statistic methods discussed above.) I believe that cca 10 us precision...