From b779b71b00c5f5f8cb9f0ee7d8feeadf9e2dca48 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 30 Mar 2024 16:12:02 -0700 Subject: util funcs reorg --- docs/reference/src/util/nng_clock.md | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/reference/src/util/nng_clock.md (limited to 'docs/reference/src/util/nng_clock.md') diff --git a/docs/reference/src/util/nng_clock.md b/docs/reference/src/util/nng_clock.md new file mode 100644 index 00000000..d2b69fb9 --- /dev/null +++ b/docs/reference/src/util/nng_clock.md @@ -0,0 +1,46 @@ +# nng_clock + +## NAME + +nng_clock - get time + +## SYNOPSIS + +```c +#include +#include + +typedef uint64_t nng_time; + +nng_time nng_clock(void); +``` + +## DESCRIPTION + +The `nng_clock()` function returns the number of elapsed milliseconds since some +arbitrary time in the past. +The resolution of the clock depends on the underlying timing facilities +of the system. +This function may be used for timing, but applications should not expect +very fine-grained values. + +> [!NOTE] +> The reference time will be the same for a given program, +> but different programs may have different references. + +This function is intended to help with setting appropriate +timeouts using [`nng_cv_until()`][nng_cv_until] +or [`nng_aio_set_expire()`][nng_aio_set_timeout]. + +## RETURN VALUES + +Milliseconds since reference time. + +## SEE ALSO + +[nng_sleep_aio][nng_sleep_aio], +[nng_cv_until][nng_cv_until], +[nng_msleep][nng_msleep], +[nng_duration][duration] + +{{#include ../refs.md}} -- cgit v1.2.3-70-g09d2