LeechCraft  0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
timer.cpp
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #include "timer.h"
10 #include <QTimer>
11 
12 namespace LC::Util::detail
13 {
15  {
16  return false;
17  }
18 
19  void TimerAwaiter::await_suspend (std::coroutine_handle<> handle) noexcept
20  {
21  QTimer::singleShot (Duration_, handle);
22  }
23 
25  {
26  }
27 }
28 
29 namespace LC
30 {
31  Util::detail::TimerAwaiter operator co_await (std::chrono::milliseconds duration)
32  {
33  return Util::detail::TimerAwaiter { duration, Qt::CoarseTimer };
34  }
35 }
bool await_ready() const noexcept
Definition: timer.cpp:14
void await_resume() const noexcept
Definition: timer.cpp:24
void await_suspend(std::coroutine_handle<> handle) noexcept
Definition: timer.cpp:19
auto Tup2 &&tup2 noexcept
Definition: ctstringutils.h:41