ZeroTierOne
ZeroTierOne copied to clipboard
Use ticks and not wall time to do internal timings when possible
On Windows this is easy. On Linux this is CLOCK_MONOTONIC_RAW or CLOCK_MONOTONIC_COARSE. Not sure about others. Wall time can be used if a faster and invariant (on a given boot) timer is not available. Note that a few functions like detecting sleep/wake will still need to use wall time.
Looks like CLOCK_MONOTONIC_COARSE is the way to go on Linux and mach_absolute_time() on OSX, at least as far as performance go. Windows has a well known ticks function. Other platforms can use wall time.