Created
April 5, 2015 02:37
-
-
Save savanovich/71b382e274af4245b3d0 to your computer and use it in GitHub Desktop.
Measure working time
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
### gcc -std=c11 -O0 -Wall -o measure_time measure_time.c | |
#include <stdio.h> | |
#include <time.h> | |
int main() | |
{ | |
clock_t start = clock(); | |
for (int i = 0; i < 10000; i++) | |
i += 1; | |
clock_t end = clock(); | |
double result = (end - start) / (double) CLOCKS_PER_SEC; | |
printf("%lf\n", result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment