How to stop time from running backwards on Linux?

后端 未结 5 1110
情书的邮戳
情书的邮戳 2021-02-12 11:15

Here\'s a little test I\'ve written to verify that time does indeed only run forwards in Linux.

#include 
#include   

bool timeG         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-12 11:30

    Machine timers on most machines only have about 15 usec precision (even to native code). Time going 'backward' is odd, but you really can't rely on that level (1 usec) anyway. (Also note: there is a difference between precision and accuracy; the accuracy of most timers is worse than its precision). The use of a virtual machine may aggravate this as well.

    Update: Typo

提交回复
热议问题