Re: Clarification of CLOCK_MONOTONIC

Anders Magnusson <[email protected]> Mon, 8 Jun 2026 15:37:45 +0200
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
FYI; slight correction;

> 
> * macOS
> 
> By hearsay [MOZILLATIME], since I am having trouble finding macOS man
> pages on the web, it sounds like:
> 
> - CLOCK_MONOTONIC counts time since boot, incl. suspend
> - CLOCK_MONOTONIC_RAW counts time running since boot, excl. suspend
> 
The manpage on MacOS says:

      CLOCK_MONOTONIC
	clock that increments monotonically, tracking the time
         since an arbitrary point, and will continue to
         increment while the system is asleep.

      CLOCK_MONOTONIC_RAW
         clock that increments monotonically, tracking the time
         since an arbitrary point like CLOCK_MONOTONIC.
         However, this clock is unaffected by frequency or time
         adjustments.  It should not be compared to other
         system time sources.

      CLOCK_UPTIME_RAW
	clock that increments monotonically, in the same
	manner as CLOCK_MONOTONIC_RAW, but that does not
	increment while the system is asleep.  The returned
	value is identical to the result of
	mach_absolute_time() after the appropriate
	mach_timebase conversion is applied.