HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
awaitable_timer_impl.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "awaitable_timer_intf.hpp"
8#include "loop_win32_intf.hpp"
9#include "../macros.hpp"
10#include <utility>
11#include <coroutine>
12#include <chrono>
13
14hi_export_module(hikogui.dispatch : awaitable_timer_impl);
15
16hi_export namespace hi::inline v1 {
17
18inline void awaitable_timer::await_suspend(std::coroutine_handle<> handle) noexcept
19{
20 _callback = loop::local().delay_function(_deadline, [=]() {
21 handle.resume();
22 });
23}
24
25}
DOXYGEN BUG.
Definition algorithm_misc.hpp:20