Open main menu

CDOT Wiki β

Changes

GPU621/NoName

4 bytes added, 11:32, 24 November 2016
C++11 code
====C++11 code====
#include <iostream> #include <omp.h> #include <chrono> #include <vector> #include <thread>  using namespace std;  void doNothing() {}  int run(int algorithmToRun) {
auto startTime = std::chrono::system_clock::now();
 
for(int j=1; j<100000; ++j)
{
}
}
 
auto endTime = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = endTime - startTime;
 
return elapsed_seconds.count();
int main() {
int cppt = run(1);
int ompt = run(2);
 
cout<<cppt<<endl;
cout<<ompt<<endl;
 
return 0;
}
23
edits