Created
February 2, 2016 06:00
-
-
Save anderspitman/0d987e7f95dd110c746a 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 <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