qh_get_nstime()

Updated: April 19, 2023

Gets the (adjusted) time from the clock with the specified ID, in nanoseconds

Synopsis:

#include <qh/time.h>
uint64_t qh_get_nstime(clockid_t clock_id,
                       uint64_t forward_offset_ns)

Arguments:

clock_id
The ID of the clock to get the time from.
forward_offset_ns
The number of nanoseconds by which to adjust the time forward.

Library:

qh

Returns:

The time from the clock specified by clock_id in nanoseconds, or zero if an error occurs (errno is set).