diff --git a/DRAMSys/simulator/main.cpp b/DRAMSys/simulator/main.cpp index ca6e6ead..5d6403f8 100644 --- a/DRAMSys/simulator/main.cpp +++ b/DRAMSys/simulator/main.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "DRAMSys.h" #include "TraceSetup.h" @@ -53,6 +53,11 @@ string pathOfFile(string file) return file.substr(0, file.find_last_of('/')); } +int main(int argc, char **argv) +{ + return sc_main(argc, argv); +} + int sc_main(int argc, char **argv) { sc_set_time_resolution(1, SC_PS); @@ -105,7 +110,7 @@ int sc_main(int argc, char **argv) } // Store the starting of the simulation in wallclock time: - clock_t simStartTime = clock(); + auto start = std::chrono::high_resolution_clock::now(); // Kickstart the players: for (auto &p : players) { @@ -116,8 +121,9 @@ int sc_main(int argc, char **argv) sc_set_stop_mode(SC_STOP_FINISH_DELTA); sc_start(); - double elapsed_secs = double(clock() - simStartTime) / CLOCKS_PER_SEC; - cout << "Simulation took " + to_string(elapsed_secs) + " seconds" << endl; + auto finish = std::chrono::high_resolution_clock::now(); + std::chrono::duration elapsed = finish - start; + std::cout << "Simulation took " + std::to_string(elapsed.count()) + " seconds." << std::endl; delete dramSys; delete ts;