トリッキーなコード その2
■ このスレッドは過去ログ倉庫に格納されています
0132129
NGNGSleep(10);
SetPriorityClass(hprocess, REALTIME_PRIORITY_CLASS);
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
QueryPerformanceCounter((LARGE_INTEGER*)&start);
func();
QueryPerformanceCounter((LARGE_INTEGER*)&end);
SetPriorityClass(hprocess, oldclass);
return (int)(end-start);
}
main()
{
printf("func1 = %d\n", prof(func1));
printf("func2 = %d\n", prof(func2));
printf("func3 = %d\n", prof(func3));
printf("func4 = %d\n", prof(func4));
}
結果
func1 = 6685
func2 = 9706
func3 = 6426
func4 = 10277
xchg が一番早い。xorが一番遅い。
■ このスレッドは過去ログ倉庫に格納されています