NNG_STAT_TIMESTAMP(3)

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

πŸ’– nng_stat_timestamp β€” get statistic timestamp πŸ’–

okay bestie, pull up a chair, we're looking at nng_stat_timestamp(3) from the NNG Reference Manual and it's genuinely such a cute little function. no cap. πŸ¦‹


✨ SYNOPSIS ✨

#include <nng/nng.h>

typedef struct nng_stat nng_stat;

uint64_t nng_stat_timestamp(nng_stat *stat);

like, that's it. that's the whole vibe. πŸŽ€


🌸 DESCRIPTION 🌸

so nng_stat_timestamp() hands you back a timestamp, and that timestamp is measured as a number of milliseconds since some arbitrary value in the past. yes, arbitrary. it's not epoch time, it's not your birthday, it's just... some point. we don't ask. πŸ’…

and here's the part that's lowkey important: even within the same snapshot, different statistics might have different timestamp values?? 😭 iconic behaviour actually. that's because the timestamp represents the moment when that particular statistic was captured β€” not when the whole snapshot got assembled. every stat has main character energy and its own little moment in time. πŸ‘‘

Tip πŸ’‘ these values are intended to facilitate calculation of rates, by comparing values from one snapshot with a subsequent one. so like, snapshot, snapshot again, do a lil subtraction, boom β€” you've got yourself a rate. math ate. πŸ”₯
Tip πŸ’‘ the values used here have the same offset as the nng_clock() supplemental function. super useful when you want to convert these values into local clock time. iykyk. ⭐

🌈 RETURN VALUES 🌈

the timestamp when stat was captured, measured as a number of milliseconds since some time in the past. she's giving "vibes-based chronology" and honestly? we respect it. 🫢


πŸŽ€ ERRORS πŸŽ€

None. literally none. no error states, no sadness, no drama. this function is unbothered, moisturized, in her lane, focused, flourishing. ✨


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page bestie!! πŸ¦‹πŸ’– go forth and timestamp responsibly. this was NNG Reference Manual, dated 2026-06-30 β€” love her, respect her, cite her. mwah. πŸ’…πŸŒΈπŸŽ€

πŸ“¦ where this page comes from