mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
Ladybird/Qt: Use a precise timer for event loop timer events
This improves the accuracy of `setTimeout()`.
This commit is contained in:
committed by
Andrew Kaster
parent
ee765e241e
commit
a968bc6f80
@@ -91,6 +91,7 @@ static void qt_timer_fired(Core::TimerShouldFireWhenNotVisible should_fire_when_
|
||||
intptr_t EventLoopManagerQt::register_timer(Core::EventReceiver& object, int milliseconds, bool should_reload, Core::TimerShouldFireWhenNotVisible should_fire_when_not_visible)
|
||||
{
|
||||
auto timer = new QTimer;
|
||||
timer->setTimerType(Qt::PreciseTimer);
|
||||
timer->setInterval(milliseconds);
|
||||
timer->setSingleShot(!should_reload);
|
||||
auto weak_object = object.make_weak_ptr();
|
||||
|
||||
Reference in New Issue
Block a user