Skip to content

Commit 2ba38c4

Browse files
committed
Nits
1 parent 2fee380 commit 2ba38c4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/timer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void Timer::stop()
140140
mStopped = true;
141141
}
142142

143-
void Timer::calculateAndOutputTimeDiff(const std::chrono::system_clock::time_point& start, const std::chrono::system_clock::time_point& end)
143+
void Timer::calculateAndOutputTimeDiff(const tp& start, const tp& end)
144144
{
145145
auto diff = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
146146

lib/timer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ class CPPCHECKLIB Timer {
7979
Timer(const Timer&) = delete;
8080
Timer& operator=(const Timer&) = delete;
8181

82-
static std::chrono::system_clock::time_point now() {
82+
using tp = std::chrono::time_point<std::chrono::high_resolution_clock>;
83+
84+
static tp now() {
8385
return std::chrono::high_resolution_clock::now();
8486
}
8587

86-
static void calculateAndOutputTimeDiff(const std::chrono::system_clock::time_point& start, const std::chrono::system_clock::time_point& end);
88+
static void calculateAndOutputTimeDiff(const tp& start, const tp& end);
8789

8890
void stop();
8991

0 commit comments

Comments
 (0)