summaryrefslogtreecommitdiff
path: root/docs/reference/src/api/nng_clock.md
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-03-24 12:53:58 -0700
committerGarrett D'Amore <garrett@damore.org>2024-03-24 12:53:58 -0700
commitb24ef189f1dc9f9bf4889cb420e4645721728036 (patch)
tree1dd4be3ce52c9c07018fb2a1d35c425e6dd33352 /docs/reference/src/api/nng_clock.md
parent85fbe7f9e4642b554d0d97f2e3ff2aa12978691a (diff)
downloadnng-b24ef189f1dc9f9bf4889cb420e4645721728036.tar.gz
nng-b24ef189f1dc9f9bf4889cb420e4645721728036.tar.bz2
nng-b24ef189f1dc9f9bf4889cb420e4645721728036.zip
Initial swag at mdbook content.
This has the nng_a* to nng_c* content converted. Various editorial changes have been made as well.
Diffstat (limited to 'docs/reference/src/api/nng_clock.md')
-rw-r--r--docs/reference/src/api/nng_clock.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/reference/src/api/nng_clock.md b/docs/reference/src/api/nng_clock.md
new file mode 100644
index 00000000..37be0d0c
--- /dev/null
+++ b/docs/reference/src/api/nng_clock.md
@@ -0,0 +1,43 @@
+# nng_clock()
+
+## NAME
+
+nng_clock - get time
+
+## SYNOPSIS
+
+```c
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.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.md).
+
+## RETURN VALUES
+
+Milliseconds since reference time.
+
+## SEE ALSO
+
+[nng_sleep_aio()](nng_sleep_aio.md),
+[nng_cv_until()](nng_cv_until.md),
+[nng_msleep()](nng_msleep.md),
+[nng_duration](nng_duration.md)