aboutsummaryrefslogtreecommitdiff
path: root/docs/ref/api/util/nng_clock.md
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-10-06 17:10:44 -0700
committerGarrett D'Amore <garrett@damore.org>2024-10-06 17:11:55 -0700
commitd9baafa0626e350a185dfe7b886039ff16dddb57 (patch)
tree1643f0aabad35388b53c5dd3c815e772528dc2ff /docs/ref/api/util/nng_clock.md
parentfa271628fc0d92df1d453cc4e1b4f715e04fa8c3 (diff)
downloadnng-d9baafa0626e350a185dfe7b886039ff16dddb57.tar.gz
nng-d9baafa0626e350a185dfe7b886039ff16dddb57.tar.bz2
nng-d9baafa0626e350a185dfe7b886039ff16dddb57.zip
Convert nng_clock and nng_msleep docs to mdbook
Diffstat (limited to 'docs/ref/api/util/nng_clock.md')
-rw-r--r--docs/ref/api/util/nng_clock.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/docs/ref/api/util/nng_clock.md b/docs/ref/api/util/nng_clock.md
new file mode 100644
index 00000000..f4e9f9d5
--- /dev/null
+++ b/docs/ref/api/util/nng_clock.md
@@ -0,0 +1,47 @@
+# nng_clock
+
+## NAME
+
+nng_clock - get time
+
+## SYNOPSIS
+
+```c
+#include <nng/nng.h>
+
+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_cv_until][nng_cv_until],
+[nng_msleep][nng_msleep],
+[nng_sleep_aio][nng_sleep_aio]
+
+[nng_cv_until]: ../thr/nng_cv.md
+[nng_msleep]: ../util/nng_msleep.md
+[nng_sleep_aio]: ../aio/nng_sleep_aio.md
+[nng_aio_set_timeout]: ../aio/nng_aio_set_timeout.md