Clarification of CLOCK_MONOTONIC

JJ <[email protected]> Sun, 7 Jun 2026 09:27:41 +1000
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <TYZPR02MB6044C917C62C3A8A6C225C12D61E2@TYZPR02MB6044.apcprd02.prod.outlook.com>
Hi all,

A "simple" question about CLOCK_MONOTONIC.

How does this behave under sleep states? See clock_gettime(2) or 
clock_getres(2)

For example, in FreeBSD (per the manual page), it states:

"Increments in SI seconds, even while the system is suspended.
Its epoch is unspecified. The count is not adjusted by leap seconds."

NetBSD makes no such pronouncement.

In code, for say, Linux kernel I would use CLOCK_BOOTTIME because it is 
aware of suspension yet CLOCK_MONOTONIC is not.
On FreeBSD I would use CLOCK_MONOTONIC as it does as it says on the 
label/man page.

On NetBSD????


Regards,

JJ