fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <ctime>
  4.  
  5. int main()
  6. {
  7. float initial_time = clock();
  8.  
  9. std::vector<int> v(1000000);
  10.  
  11. #pragma omp parallel for
  12. for (int j=0; j<64; j++)
  13. {
  14. for (int i=0; i<1000000; i++)
  15. {
  16. v[i] = i;
  17. }
  18. }
  19.  
  20. std::cout<<(clock()-initial_time)/CLOCKS_PER_SEC;
  21. }
Success #stdin #stdout 0.03s 6988KB
stdin
Standard input is empty
stdout
0.021012