How to stop time from running backwards on Linux?

后端 未结 5 1112
情书的邮戳
情书的邮戳 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条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-12 11:39

    It's not that it's running backwards. It'd be better to say that it is not reporting the correct time. This is because computers, without the aid of a dedicated timing subsystem, simply are not capable of reporting time very accurately in single millisecond intervals.

    The precision will vary with hardware, the OS and even the power supply. Here is an article for starters. A bit old but communicates the idea nicely.

提交回复
热议问题