diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/SUMMARY.md | 1 | ||||
| -rw-r--r-- | docs/ref/api/util/index.md | 1 | ||||
| -rw-r--r-- | docs/ref/api/util/nng_duration.md | 33 |
3 files changed, 35 insertions, 0 deletions
diff --git a/docs/ref/SUMMARY.md b/docs/ref/SUMMARY.md index d6663a78..c994ecd5 100644 --- a/docs/ref/SUMMARY.md +++ b/docs/ref/SUMMARY.md @@ -12,6 +12,7 @@ - [nng_alloc](./api/util/nng_alloc.md) - [nng_clock](./api/util/nng_clock.md) + - [nng_duration](./api/util/nng_duration.md) - [nng_id_map](./api/util/nng_id_map.md) - [nng_msleep](./api/util/nng_msleep.md) - [nng_opts_parse](./api/util/nng_opts_parse.md) 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. |
