| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]

# Method gethrtime()

Method gethrtime

  `int gethrtime(void|int nsec)`

Description

  Return the high resolution real time since some arbitrary event in the past. The time is normally returned in microseconds, but if the optional argument nsec is nonzero it's returned in nanoseconds.

  It's system dependent whether or not this time is monotonic, i.e. if it's unaffected by adjustments of the calendaric clock in the system. System.REAL_TIME_IS_MONOTONIC tells what it is. Pike tries to use monotonic time for this function if it's available.

Note

  The actual accuracy on many systems is significantly less than microseconds or nanoseconds. See System.REAL_TIME_RESOLUTION .

See also

  System.REAL_TIME_IS_MONOTONIC , System.REAL_TIME_RESOLUTION , time() , System.gettimeofday() , gethrvtime() , Pike.implicit_gc_real_time