Last active
October 30, 2015 15:09
-
-
Save poseidon4o/60995826b511ae7ecca7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
void main() { | |
double PCFreq = 0.0; | |
__int64 CounterStart = 0; | |
LARGE_INTEGER fr, start, end; | |
BOOL res = QueryPerformanceFrequency(&fr); | |
PCFreq = double(fr.QuadPart) / 1000.0; | |
QueryPerformanceCounter(&start); | |
{ | |
int x = 0; | |
for (int c = 0; c < 1000000; c++) { | |
x ^= c; | |
} | |
} | |
QueryPerformanceCounter(&end); | |
double time = double(end.QuadPart - start.QuadPart) / PCFreq; | |
cout << time; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment