通常,我们调用函数gettimeofday
来获取系统的当前时间。
如果用户使用 date
命令更改时钟会发生什么?
它是否影响函数 gettimeofday
的结果?
最佳答案
参见 here :
The time returned by gettimeofday() is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the system time). If you need a monotonically increasing clock, see clock_gettime(2).
所以,是的,它是。
关于linux - date命令会影响gettimeofday()的结果吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37135197/