The gethrtime() function returns the current high-resolution real time. Time is expressed as nanoseconds since some arbitrary time in the past; it is not correlated in any way to
the time of day, and thus is not subject to resetting or drifting by way of adjtime(2) or settimeofday(3C). The hi-res timer
is ideally suited to performance measurement tasks, where cheap, accurate interval timing is required.
The gethrvtime() function returns the current high-resolution LWP virtual time, expressed as total nanoseconds of execution time. This function requires that micro state accounting
be enabled with the ptime utility (see proc(1)).
The gethrtime() and gethrvtime() functions both return an hrtime_t, which is a 64-bit (long long) signed integer.
|