1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:37:45 +00:00

LibCore: Add ElapsedTimer::reset()

This commit is contained in:
Jelle Raaijmakers 2021-10-27 23:41:32 +02:00 committed by Andreas Kling
parent ae405ed2eb
commit 7c939c58b8
2 changed files with 7 additions and 0 deletions

View file

@ -28,6 +28,12 @@ void ElapsedTimer::start()
m_origin_time.tv_usec = now_spec.tv_nsec / 1000;
}
void ElapsedTimer::reset()
{
m_valid = false;
m_origin_time = { 0, 0 };
}
int ElapsedTimer::elapsed() const
{
VERIFY(is_valid());

View file

@ -22,6 +22,7 @@ public:
bool is_valid() const { return m_valid; }
void start();
void reset();
int elapsed() const;
Time elapsed_time() const;