summaryrefslogtreecommitdiff
path: root/toxcore/mono_time.h
AgeCommit message (Collapse)Author
2020-03-14Use spdx license identifier instead of GPL blurb.iphydf
2018-10-31Add some hopefully helpful documentation to the functions in mono_time.hzugz (tox)
(I found I couldn't remember whether get_mono_time returned unix time or not, and had to source-dive to find out. This should make that unnecessary next time!)
2018-09-14Standardise header guards.iphydf
Using the full path including the repo name.
2018-09-03Avoid use of global mutable state in mono_time on win32.iphydf
This uses a trick to get read-write access to `this` from a `const` member function, similar to C++ `mutable`, but uglier.
2018-08-26Add support for setting a custom monotonic time function in mono_timezugz (tox)
2018-08-21consistently use 'mono_time' rather than 'monotime'zugz (tox)
2018-08-19make Mono_Time an argument to current_time_monotoniczugz (tox)
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-08-10Use the crypto random functions instead of `rand()`.iphydf
Presumably the uses of `rand()` were fine because they were not used in security-sensitive places, but having to think about whether a crappy RNG is acceptable in each situation requires effort that could better be spent elsewhere. Also, this means that once we have a custom deterministic RNG for testing, that RNG is used everywhere, so all the code is deterministic. It also allowed us to delete a system-specific function that wasn't used anywhere except in a call to `srand()`.
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ```