Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我现在从多个线程中调用,我可以假设这没问题还是我需要为此实现锁定?我知道日期时间格式不安全,但是日期时间读取呢?另外,QueryPerformanceCounter 呢?我已经查看但找不到任何关于这些低级函数的线程安全的权威文档。
你有访问权限SysUtils.pas吗?我有旧的 Delphi4 源代码,其中Source\Rtl\Sys\SysUtils.pas有Now(). 似乎它使用了 Win APIGetLocalTime()和它自己的EncodeDate()和EncodeTime()函数。它们都是线程安全的,所以Now()也是线程安全的。
SysUtils.pas
Source\Rtl\Sys\SysUtils.pas
Now()
GetLocalTime()
EncodeDate()
EncodeTime()