Skip to content

Instantly share code, notes, and snippets.

@OtavioHenrique
Last active November 2, 2018 19:57
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 OtavioHenrique/37a8fb027edd41c021bb74897d36262e to your computer and use it in GitHub Desktop.
Save OtavioHenrique/37a8fb027edd41c021bb74897d36262e to your computer and use it in GitHub Desktop.
#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