diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-10-11 23:38:41 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-10-11 23:38:41 -0700 |
| commit | 786abec6eb81a5660f20f7bf2356ad73be1cb2d1 (patch) | |
| tree | ca3b2625326e82b6d3d603114df44da62c668bc6 /docs/ref/api/util | |
| parent | 6b0b26ba0cc45ce481d76be3c22c0a4f0addf4ae (diff) | |
| download | nng-786abec6eb81a5660f20f7bf2356ad73be1cb2d1.tar.gz nng-786abec6eb81a5660f20f7bf2356ad73be1cb2d1.tar.bz2 nng-786abec6eb81a5660f20f7bf2356ad73be1cb2d1.zip | |
Convert nng_duration to mdbook.
Diffstat (limited to 'docs/ref/api/util')
| -rw-r--r-- | docs/ref/api/util/index.md | 1 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_duration.md | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/docs/ref/api/util/index.md b/docs/ref/api/util/index.md index 0650c21d..0a3cb891 100644 --- a/docs/ref/api/util/index.md +++ b/docs/ref/api/util/index.md @@ -7,6 +7,7 @@ of other uses. - [nng_alloc](nng_alloc.md) --- allocate memory - [nng_clock](nng_clock.md) --- get time +- [nng_duration](nng_duration.md) -- relative time in milliseconds - [nng_id_map](nng_id_map.md) --- identifier based mapping table - [nng_msleep](nng_msleep.md) --- sleep milliseconds - [nng_opts_parse](nng_opts_parse.md) --- parse command line options diff --git a/docs/ref/api/util/nng_duration.md b/docs/ref/api/util/nng_duration.md new file mode 100644 index 00000000..9ad76256 --- /dev/null +++ b/docs/ref/api/util/nng_duration.md @@ -0,0 +1,33 @@ +# nng_duration + +## NAME + +nng_duration --- relative time in milliseconds + +## SYNOPSIS + +```c +#include <nng/nng.h> + +typedef int32_t nng_duration; + +#define NNG_DURATION_INFINITE (-1) +#define NNG_DURATION_DEFAULT (-2) +#define NNG_DURATION_ZERO (0) +``` + +## DESCRIPTION + +An {{i:`nng_duration`}}{{hi:duration}} is a relative time, measured in {{i:milliseconds}}. +This type is most often used in conjunction with timers and timeouts. + +A couple of special values have been set aside, and carry special meanings. + +- {{i:`NNG_DURATION_DEFAULT`}}: + Indicates a context-specific default value should be used. + +- {{i:`NNG_DURATION_INFINITE`}}: + Effectively an infinite duration; used most often to disable timeouts. + +- {{i:`NNG_DURATION_ZERO`}}: + Zero length duration; used to perform an immediate poll. |
