aboutsummaryrefslogtreecommitdiff
path: root/include/util/time.h
AgeCommit message (Collapse)Author
2022-11-25util/time: use int64_t return value for get_current_time_msec()Simon Ser
0xFFFFFFFF milliseconds is 4,294,967,295 ms so about 50 days. A little bit too close for comfort. Use int64_t instead of uint64_t to avoid C's implicit conversion footguns in computations.
2020-12-18util/time: add timespec_from_nsecSimon Ser
2020-06-06util/time: move `timespec_sub` to time utilitiesTudor Brindus
2020-06-06util/time: de-duplicate `timespec_to_msec`Tudor Brindus
2020-06-06util: fix and move `get_current_time_msec` into a util fileTudor Brindus
This commit makes `get_current_time_msec` correctly return milliseconds as opposed to microseconds. It also considers the value of `tv_sec`, so we don't lose occasionally go back in time by one second. Finally, the function is moved into `util/time.cc` so that it can be reused elsewhere without having to consider these pitfalls.