Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
High-precision date/time in C (antonz.org)
3 points by blenderob 43 days ago | hide | past | favorite | 1 comment


> Time is a pair (seconds, nanoseconds),

I expect something diffferent, but isn't this just timespec_t[0] with different epoch? It's been in in POSIX since 2001.

The upside of timespec_t is it uses regular Unix epoch for seconds time, so thre is no need for things like "time_get_year", you use regular time_t APIs for that.

[0] https://man7.org/linux/man-pages/man3/timespec.3type.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: