Last active
November 2, 2018 19:57
-
-
Save OtavioHenrique/37a8fb027edd41c021bb74897d36262e 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 <stdio.h> | |
#include <time.h> | |
int main () { | |
clock_t begin = clock(); | |
int ni = 3000, nj = 3000, nk = 3000; | |
for(int i = 0; i < ni; i++) { | |
for(int j = 0; j < nj; j++) { | |
for(int k = 0; k < nk; k++) { | |
int result = i * j * k; | |
} | |
} | |
} | |
clock_t end = clock(); | |
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; | |
printf("%f", time_spent); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment