Skip to content

Instantly share code, notes, and snippets.

@savanovich
Created April 5, 2015 02:37
Show Gist options
  • Save savanovich/71b382e274af4245b3d0 to your computer and use it in GitHub Desktop.
Save savanovich/71b382e274af4245b3d0 to your computer and use it in GitHub Desktop.
Measure working time
### 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