Skip to content

Commit 2e8b8b9

Browse files
committed
Timer: added missing lock for SHOWTIME_FILE_TOTAL printing
1 parent c2af315 commit 2e8b8b9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/timer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ void Timer::stop()
132132
std::cout << mStr << ": " << sec << "s" << std::endl;
133133
} else if (mShowTimeMode == SHOWTIME_MODES::SHOWTIME_FILE_TOTAL) {
134134
const double sec = (double)diff / CLOCKS_PER_SEC;
135+
std::lock_guard<std::mutex> l(stdCoutLock);
135136
std::cout << "Check time: " << mStr << ": " << sec << "s" << std::endl;
136137
} else {
137138
if (mTimerResults)

0 commit comments

Comments
 (0)