Worse, I could measure a 10-second event as taking −34 seconds, ending before it began. If I turn my watch back 44 seconds while timing a 60-second event, I would (unless I correct for the reset) measure the event as taking 16 seconds. If I reset my watch to match my computer while I am timing an event, the time of day it shows is now more accurate, but subtracting the start and end times for the event will produce a measurement that includes the reset. Resetting a clock makes it better for telling time but useless, in that moment, for measuring time. If I start timing an event by checking the time, and then I stop timing the event by checking again and subtracting the two times, the error contributed by the watch speed will be under 0.01%. My watch may not be perfect for identifying the precise moment when a meeting should begin, but it's quite good for measuring elapsed time. In a few days I will probably be bothered enough to reset it to match the computer. Compared to the computer, my watch gains about five seconds a day. As I write this, the watch on my wrist is 44 seconds ahead of the clock on my computer. Eventually, someone notices, decides the accumulated error-compared to a reference clock deemed more reliable-is large enough to be worth fixing, and resets the clock to match the reference. Background ClocksĪ clock never keeps perfect time. Among other benefits, this should make it impossible for a basic elapsed time measurement using time.Now and time.Since to report a negative duration or other result not grounded in reality. We propose to extend the time.Time representation to hold an additional monotonic clock reading for use in those calculations. Proposal: Monotonic Elapsed Time Measurements in GoĬomparison and subtraction of times observed by time.Now can return incorrect results if the system wall clock is reset between the two observations.
0 Comments
Leave a Reply. |