Skip to content

Commit d2d34a7

Browse files
committed
QPR-10078 use std::chrono timer instead of linking timer
1 parent 8d12fa8 commit d2d34a7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test-suite/paralleltestrunner.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ test_suite* init_unit_test_suite(int, char*[]);
131131

132132
int main(int argc, char* argv[]) {
133133
typedef QuantLib::Time Time;
134-
boost::timer::cpu_timer testTimer;
135134

136135
std::string moduleName = BOOST_TEST_MODULE;
137136
std::string profileFileNameStr = moduleName + "_unit_test_profile.txt";
@@ -151,6 +150,7 @@ int main(int argc, char* argv[]) {
151150
try {
152151
unsigned int priority;
153152
if (!clientMode) {
153+
auto startTime = std::chrono::steady_clock::now();
154154
std::map<std::string, Time> runTimeLog;
155155

156156
std::ifstream in(profileFileName);
@@ -307,8 +307,10 @@ int main(int argc, char* argv[]) {
307307
thread.join();
308308
}
309309

310-
testTimer.stop();
311-
double seconds = testTimer.elapsed().wall * 1e-9;
310+
auto stopTime = std::chrono::steady_clock::now();
311+
double seconds =
312+
std::chrono::duration_cast<std::chrono::microseconds>(stopTime - startTime)
313+
.count() * 1e-6;
312314
int hours = int(seconds / 3600);
313315
seconds -= hours * 3600;
314316
int minutes = int(seconds / 60);

0 commit comments

Comments
 (0)