今天无事,测试了下Windows上几个获取时间戳的函数效率 函数
机器性能: 性能
CPU I7 2600K 未超频 测试
测试1亿次调用 code
1. CRT 的time()函数耗时在1秒左右 it
2. Win API 的GetTickCount() 在300毫秒左右,GetTickCount64() 在500毫秒左右 asm
3 .Wimm.lib 的timeGetTime()在800毫秒左右 class
4 .//这段代码的耗时测试在8秒左右 效率
inline unsigned __int64 GetCycleCount() { __asm _emit 0x0F __asm _emit 0x31 }