NNG_DURATION(5)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’– NNG_DURATION β€” relative time in milliseconds, bestie πŸ’–

okay so real quick, before we get into it: this is page NNG_DURATION(5) from the NNG Reference Manual, and yes she's a whole vibe. let's go πŸ¦‹


✨ NAME ✨

nng_duration β€” literally just a relative time in milliseconds, no cap ⏱️


🌸 SYNOPSIS 🌸

#include <nng/nng.h>

typedef int32_t nng_duration;

#define NNG_DURATION_INFINITE (-1)
#define NNG_DURATION_DEFAULT  (-2)
#define NNG_DURATION_ZERO     (0)

like. it's an int32_t. that's the whole thing. gorgeous. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so an nng_duration is a relative time, measured in milliseconds. that's it, that's the girl. she's most often hanging out with timers and timeouts, because obviously, that's her main character era. πŸ‘‘

and then there's a couple of special values that got set aside that carry ✨special meanings✨ β€” think of them as the VIP section of the duration type:

  • NNG_DURATION_DEFAULT β€” this one's like "idk, use the context-specific default, whatever that is". she's the "you pick" friend. πŸ™ˆ
  • NNG_DURATION_INFINITE β€” effectively an infinite duration. used most often to disable timeouts entirely. she does not do deadlines, she does not do clocks, she is forever. πŸ’€
  • NNG_DURATION_ZERO β€” a zero-length duration. this one's for performing a single polling operation, i.e. "check once and move on, don't wait around for anybody." 🫢
also lowkey important: the value of NNG_DURATION_INFINITE is (-1), the value of NNG_DURATION_DEFAULT is (-2), and NNG_DURATION_ZERO is (0). they are negative and zero on purpose, bestie. not a typo. iconic behaviour honestly.

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykwim 🌈


and that's the page!! this was NNG_DURATION(5) from the NNG Reference Manual, dated 2026-06-30. slay, periodt, go set a timeout responsibly πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from