Use monotonic clocks for timing #96
Comments
Turns out that the It was going to be based on the spacemonkeygo code but it ended up not being a single line of code from there. I lifted the |
What first sent me down the path of discovery was that using |
Currently the timing metrics collected use a realtime clock provided by
time.Now()
. This is inaccurate for timing purposes where we care about the actual amount of time that has passed vs. the time that has passed in the "real" wall-clock time. Clock adjustments can provide wildly inaccurate timing for short-term actions. The answer, unfortunately, is to create a package that can provide a raw monotonic clock read by calling clock_gettime through VDSO.This must be done in assembly to conform to the C calling conventions. This is a paved path, which is really nice for us. spacemonkeygo has a proper package to do this:
https://github.com/spacemonkeygo/monotime/blob/master/mono_linux_amd64.s
This code can be added to the rend project (along with proper license handling) to handle raw monotonic time.
The text was updated successfully, but these errors were encountered: