mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 02:18:00 +08:00
[Stopwatch] start()/stop() return const &
This commit is contained in:
parent
9e1d40e4dc
commit
1f055ef472
@ -14,9 +14,9 @@ namespace vcpkg
|
||||
|
||||
bool isRunning() const;
|
||||
|
||||
Stopwatch& start();
|
||||
const Stopwatch& start();
|
||||
|
||||
Stopwatch& stop();
|
||||
const Stopwatch& stop();
|
||||
|
||||
Stopwatch& reset();
|
||||
|
||||
|
@ -18,7 +18,7 @@ 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;
|
||||
@ -26,7 +26,7 @@ namespace vcpkg
|
||||
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.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user