Function

GLibget_monotonic_time_ns

unstable since: 2.88

Declaration [src]

uint64_t
g_get_monotonic_time_ns (
  void
)

Description [src]

Queries the system monotonic time in nanoseconds.

The monotonic clock will always increase and doesn’t suffer discontinuities when the user (or NTP) changes the system time. It may or may not continue to tick during times where the machine is suspended.

We try to use the clock that corresponds as closely as possible to the passage of time as measured by system calls such as poll() but it may not always be possible to do this.

Another version of this function exists. g_get_monotonic_time() returns the time in microseconds. If you want to support older GLib versions, it is an alternative.

Available since: 2.88

Return value

Type: uint64_t

The monotonic time, in nanoseconds.