fork(31) 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. clock_t t1 = clock();
  12.  
  13. for(;i<100000000;i++)
  14. pow(double(i),0.5);
  15.  
  16. cout << clock()-t1 << "\n";
  17. t1 = clock();
  18.  
  19.  
  20. for(; j<100000000;j++)
  21. sqrt(double(j));
  22.  
  23. cout << clock()-t1 << "\n";
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0.61s 2852KB
stdin
Standard input is empty
stdout
270000
340000