Userland: Use Core::Timer::create_foo() factory functions where possible

This commit is contained in:
Sam Atkins 2023-01-11 20:00:46 +00:00 committed by Andreas Kling
commit e181b1cb82
Notes: sideshowbarker 2024-07-17 05:03:11 +09:00
12 changed files with 37 additions and 51 deletions

View file

@ -326,9 +326,9 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_
auto& timer_label = widget->add<GUI::Label>("...");
Core::ElapsedTimer clock;
clock.start();
auto update_timer = Core::Timer::construct(100, [&] {
auto update_timer = Core::Timer::create_repeating(100, [&] {
timer_label.set_text(DeprecatedString::formatted("{:.1} seconds", static_cast<float>(clock.elapsed()) / 1000.0f));
});
}).release_value_but_fixme_should_propagate_errors();
update_timer->start();
auto& stop_button = widget->add<GUI::Button>("Stop");