Created
June 30, 2015 19:26
-
-
Save mlabbe/eec8ff3576fd6253e920 to your computer and use it in GitHub Desktop.
perf stricmp
This file contains hidden or 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
| #ifdef WIN32 | |
| void perf_stricmp_w32(void) | |
| { | |
| const unsigned long REPS=10000000; /* default is 10mil */ | |
| char s1[] = "dogeatdogisSTORYOFMYLIFE"; | |
| char s2[] = "DOGEATDOGISSTORYOFMYLIFE"; | |
| unsigned long i; | |
| LARGE_INTEGER frequency; | |
| LARGE_INTEGER start; | |
| LARGE_INTEGER end; | |
| double interval; | |
| printf("running perf_stricmp %lu times\n", REPS); | |
| QueryPerformanceFrequency(&frequency); | |
| QueryPerformanceCounter(&start); | |
| for (i = 0; i < REPS; ++i) | |
| { | |
| int result = ftg_stricmp(s1, s2); | |
| } | |
| QueryPerformanceCounter(&end); | |
| interval = (double) (end.QuadPart - start.QuadPart) / frequency.QuadPart; | |
| printf("interval: %f\n", interval); | |
| } | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment