#include #include #include #include #include #include #include #include using namespace std; class timer { private: typedef std::chrono::high_resolution_clock hi_res_clock; typedef std::chrono::duration > second_; std::chrono::time_point start_time ; public: timer() : start_time(hi_res_clock::now()) {} void reset() { start_time = hi_res_clock::now(); } double elapsed() const { double t ; t = std::chrono::duration_cast ( hi_res_clock::now() - start_time ).count() ; return(t) ; } }; void print_time(const string & heading , const double & t) { cout << heading << " : " ; cout.setf(ios::right); cout.setf(ios::showpoint); cout.setf(ios::fixed); cout.width(10); cout.precision(6); cout << t << endl; } void file_write(string file_name, int thread_number) { ofstream out(file_name); int i; int n=1000000; for (i=0;i