mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
LibCore: Add Core::Timer::set_active(bool)
This calls either start() or stop() depending on the boolean argument.
This commit is contained in:
parent
ae07660587
commit
d0df249666
2 changed files with 10 additions and 0 deletions
|
@ -58,6 +58,14 @@ void Timer::stop()
|
|||
m_active = false;
|
||||
}
|
||||
|
||||
void Timer::set_active(bool active)
|
||||
{
|
||||
if (active)
|
||||
start();
|
||||
else
|
||||
stop();
|
||||
}
|
||||
|
||||
void Timer::timer_event(TimerEvent&)
|
||||
{
|
||||
if (m_single_shot)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue