mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibCore: Add unit to Core::Timer interval arguments
This patch adds the _ms suffix to the interval arguments in Core::Timer, to make it a little clearer what the interval unit is to others.
This commit is contained in:
parent
2159f90e00
commit
ae9e352104
2 changed files with 22 additions and 22 deletions
|
@ -13,11 +13,11 @@ Timer::Timer(Object* parent)
|
|||
{
|
||||
}
|
||||
|
||||
Timer::Timer(int interval, Function<void()>&& timeout_handler, Object* parent)
|
||||
Timer::Timer(int interval_ms, Function<void()>&& timeout_handler, Object* parent)
|
||||
: Object(parent)
|
||||
, on_timeout(move(timeout_handler))
|
||||
{
|
||||
start(interval);
|
||||
start(interval_ms);
|
||||
}
|
||||
|
||||
Timer::~Timer()
|
||||
|
@ -26,28 +26,28 @@ Timer::~Timer()
|
|||
|
||||
void Timer::start()
|
||||
{
|
||||
start(m_interval);
|
||||
start(m_interval_ms);
|
||||
}
|
||||
|
||||
void Timer::start(int interval)
|
||||
void Timer::start(int interval_ms)
|
||||
{
|
||||
if (m_active)
|
||||
return;
|
||||
m_interval = interval;
|
||||
start_timer(interval);
|
||||
m_interval_ms = interval_ms;
|
||||
start_timer(interval_ms);
|
||||
m_active = true;
|
||||
}
|
||||
|
||||
void Timer::restart()
|
||||
{
|
||||
restart(m_interval);
|
||||
restart(m_interval_ms);
|
||||
}
|
||||
|
||||
void Timer::restart(int interval)
|
||||
void Timer::restart(int interval_ms)
|
||||
{
|
||||
if (m_active)
|
||||
stop();
|
||||
start(interval);
|
||||
start(interval_ms);
|
||||
}
|
||||
|
||||
void Timer::stop()
|
||||
|
@ -65,7 +65,7 @@ void Timer::timer_event(TimerEvent&)
|
|||
else {
|
||||
if (m_interval_dirty) {
|
||||
stop();
|
||||
start(m_interval);
|
||||
start(m_interval_ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue