Skip to content

Commit

Permalink
Convert nng_duration to mdbook.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Oct 12, 2024
1 parent 6b0b26b commit 786abec
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 50 deletions.
50 changes: 0 additions & 50 deletions docs/man/nng_duration.5.adoc

This file was deleted.

1 change: 1 addition & 0 deletions docs/ref/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions docs/ref/api/util/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions docs/ref/api/util/nng_duration.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 786abec

Please sign in to comment.