Skip to content

Instantly share code, notes, and snippets.

@anderspitman
Created February 2, 2016 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anderspitman/0d987e7f95dd110c746a to your computer and use it in GitHub Desktop.
Save anderspitman/0d987e7f95dd110c746a to your computer and use it in GitHub Desktop.
#include <time.h>
#include <stdio.h>
int main(int argc, char **argv) {
clock_t start = clock(), diff;
for (int i=100000000; i>0; i--) {
}
diff = clock() - start;
int msec = diff * 1000 / CLOCKS_PER_SEC;
printf("Time taken %d seconds %d milliseconds", msec/1000, msec%1000);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment