Skip to content

Commit

Permalink
[Stopwatch] start()/stop() return const &
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkaratarakis committed Oct 11, 2016
1 parent 9e1d40e commit 1f055ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions toolsrc/include/Stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace vcpkg

bool isRunning() const;

Stopwatch& start();
const Stopwatch& start();

Stopwatch& stop();
const Stopwatch& stop();

Stopwatch& reset();

Expand Down
4 changes: 2 additions & 2 deletions toolsrc/src/Stopwatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ namespace vcpkg
return this->m_isRunning;
}

Stopwatch& Stopwatch::start()
const Stopwatch& Stopwatch::start()
{
Checks::check_exit(!this->m_isRunning, "This stopwatch is already running.");
this->m_isRunning = true;
this->m_startTick = std::chrono::high_resolution_clock::now();
return *this;
}

Stopwatch& Stopwatch::stop()
const Stopwatch& Stopwatch::stop()
{
auto tick = std::chrono::high_resolution_clock::now();
Checks::check_exit(this->m_isRunning, "This stopwatch is already stopped.");
Expand Down

0 comments on commit 1f055ef

Please sign in to comment.