| 33 | } |
| 34 | |
| 35 | void Stop() |
| 36 | { |
| 37 | auto endTimepoint = std::chrono::high_resolution_clock::now(); |
| 38 | |
| 39 | long long start = std::chrono::time_point_cast<std::chrono::microseconds>(m_StartTimepoint).time_since_epoch().count(); |
| 40 | long long end = std::chrono::time_point_cast<std::chrono::microseconds>(endTimepoint).time_since_epoch().count(); |
| 41 | |
| 42 | auto duration = start - end; |
| 43 | double ms = (duration * 0.001) * -1; |
| 44 | |
| 45 | GameToolbox::log("TIMER [{}]|[{}]", m_Name, ms); |
| 46 | |
| 47 | m_Stopped = true; |
| 48 | } |
| 49 | private: |
| 50 | const char* m_Name; |
| 51 | std::chrono::time_point<std::chrono::high_resolution_clock> m_StartTimepoint; |