About Timer of Game Engine

本文探讨了在60FPS与59FPS之间的差异,并分析了C标准库中的clock()函数及Win32API的GetTickCount()在进行毫秒级时间测量时的局限性。进一步研究了更高精度的时间测量方法,包括Win32的QueryPerformanceFrequency()和Linux下的gettimeofday()函数。

FPS 60 time interval:0.01666666666666666666666666666667s

FPS 59 time interval:0.01694915254237288135593220338983s

difference value:0.00028248587570621468926553672316s

so 0.001s clock can't distinguish the difference between FPS 60 and FPS 59

clock() from C standard library and GetTickCount() of Win32 API  both become useless...

 

for further study。。。

1

Win32

QueryPerformanceFrequency()

Linux

gettimeofday()

2

cycle count

转载于:https://www.cnblogs.com/faeriesoft/p/4187562.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值