man gethrtime () - get high resolution time


gethrtime - get high resolution time


#include <rtl_time.h> 
hrtime_t gethrtime(void); 


This function is a non-portable RTLinux extension. gethrtime returns the time in nanoseconds since the system bootup. This time is never reset or adjusted. gethrtime always gives monotonically increasing values. hrtime_t is a 64-bit signed integer.

The HRTIME_INFINITY symbol represents the maximum possible value that gethrtime() could possibly return. This value will be never reached during the execution of the system, and can be used to designate the infinitely distant moment in time.


The actual resolution of gethrtime is hardware-dependent. It is guaranteed to be better than 1 microsecond.

gethrtime is available in PSC, the user-level real-time signal library. It can be called from handlers installed via rtlinux_sigaction(3) (link to URL rtlinux_sigaction.3.html) .


Michael Barabanov ( (link to URL )

See Also

UNIX spec clock_gettime(3) (link to URL ../susv2/xsh/clock_gettime.html) , clock_gethrtime(3) (link to URL clock_gethrtime.3.html)

©2001 FSMLabs Inc.

All rights reserved.