5#include "flutter/shell/platform/glfw/glfw_event_loop.h"
16 :
EventLoop(main_thread_id, on_task_expired) {}
20void GLFWEventLoop::WaitUntil(
const TaskTimePoint&
time) {
21 const auto now = TaskTimePoint::clock::now();
24 using Seconds = std::chrono::duration<double, std::ratio<1>>;
25 const auto duration_to_wait = std::chrono::duration_cast<Seconds>(
time - now);
27 if (duration_to_wait.count() > 0.0) {
28 ::glfwWaitEventsTimeout(duration_to_wait.count());
37void GLFWEventLoop::Wake() {
38 ::glfwPostEmptyEvent();
std::function< void(const FlutterTask *)> TaskExpiredCallback
GLFWEventLoop(std::thread::id main_thread_id, const TaskExpiredCallback &on_task_expired)
static double time(int loops, Benchmark *bench, Target *target)