fork(1) download
  1. #include<time.h>
  2. #include<math.h>
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int i = 0;
  9. int j = 0;
  10.  
  11. volatile float result;
  12.  
  13. clock_t t1 = clock();
  14.  
  15. for(;i<100000000;i++)
  16. result = pow(float(i),0.25);
  17.  
  18. cout << clock()-t1 << "\n";
  19. t1 = clock();
  20.  
  21.  
  22. for(; j<100000000;j++)
  23. result = sqrt(sqrt(float(j)));
  24.  
  25. cout << clock()-t1 << "\n";
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 4.09s 5300KB
stdin
Standard input is empty
stdout
3528279
552427