mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
LibCore: Add Timer::restart() convenience API
This simply restarts the timer with the existing millisecond interval.
This commit is contained in:
parent
5a71a57435
commit
7bb4f3764c
2 changed files with 6 additions and 0 deletions
|
@ -58,6 +58,11 @@ void Timer::start(int interval)
|
||||||
m_active = true;
|
m_active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Timer::restart()
|
||||||
|
{
|
||||||
|
restart(m_interval);
|
||||||
|
}
|
||||||
|
|
||||||
void Timer::restart(int interval)
|
void Timer::restart(int interval)
|
||||||
{
|
{
|
||||||
if (m_active)
|
if (m_active)
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void start(int interval);
|
void start(int interval);
|
||||||
|
void restart();
|
||||||
void restart(int interval);
|
void restart(int interval);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue