4

Python 不同程序 time 时间差异问题

 2 years ago
source link: https://www.v2ex.com/t/794404
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Python

Python 不同程序 time 时间差异问题

  596164296 · 2 小时 0 分钟前 · 96 次点击

场景:现在有两个程序,一个程序的运行需要依靠另一个程序的运算结果方可正常运行,如果集成到一个程序中,将造成代码臃肿、维护麻烦等一系列问题。两个程序均与时间有紧密的关系,精确度需要到毫秒级别(排除 time 本身的误差),现在第一个程序运算后得出一个时间,此时间作为第二个程序的输入。两个程序均设置 windll.winmm.timeBeginPeriod(1)。两个程序均使用 pyinstaller 打包。

疑问:其实这个问题从某个角度来说就是看 time 模块每次调用的时候是不是调用的 windows 系统时间。个人拙见!

问题:这种情况下,在同一台电脑上两个程序的时间能够达到毫秒级别精度同步,有哪位技术大牛能否给予技术解答,万分感谢。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK