fork download
  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4. void bar(volatile int& result) {
  5. for (int i = 0; i < 2000; i++)
  6. for (int b = 0; b < 2; b++)
  7. for (int c = 0; c < 3; c++)
  8. for (int d = 0; d < 4; d++)
  9. for (int e = 0; e < 5; e++)
  10. for (int f = 0; f < 6; f++)
  11. for (int g = 0; g < 7; g++)
  12. for (int h = 0; h < 8; h++)
  13. for (int j = 0; j < 9; j++)
  14. result += i + b + c + d + e + f + g + h + j;
  15. }
  16.  
  17. int main() {
  18. clock_t c = clock();
  19. int x = 0;
  20. bar(x);
  21. printf("%f\n", float(clock() - c)/CLOCKS_PER_SEC);
  22. return 0;
  23. }
Success #stdin #stdout 1.45s 4204KB
stdin
Standard input is empty
stdout
1.450288