|

楼主 |
发表于 2010-12-5 20:45:00
|
显示全部楼层
Re:请教mangos中的一个游戏循环中的频率是怎么得来的?
#include<stdio.h>
#include<windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
int i,k,r;
DWORD t = GetTickCount();
while(1)
{
DWORD t1 = GetTickCount();
DWORD r = t1-t;
if(r > 0)
{
printf("%d %d %d\n",r, t1, t) ;
t = t1;
break;
}
}
getchar();
return 0;
}
这样对吗? 获得的时差win7系统 大概在15ms |
|