做多核优化时发现一个问题,十分诡异!
DWORD worktime;
DWORD start,end;
printf("\n");
start = GetTickCount();
DoSomething();
end = GetTickCount();
worktime = end - start;
printf("use %lld mmsec\n", worktime);
下面是DoSomething函数
void DoSomething()
{
for(int i=0;i<10;i++)
{
//do nothing
}
}
这段代码在Debug下打印
use 0 mmsec
在Release下打印
use 201863462912 mmsec