From 2ae12fb0a0f5c81e5c1ab5c690bbe5a138368ca0 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Thu, 31 Mar 2022 13:38:02 -0700 Subject: [PATCH] Discourage use of WaitUntil to implement VSync (#2230) --- src/event_loop.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/event_loop.rs b/src/event_loop.rs index 17bca97c..25c3ccd4 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -140,6 +140,10 @@ pub enum ControlFlow { Wait, /// When the current loop iteration finishes, suspend the thread until either another event /// arrives or the given time is reached. + /// + /// Useful for implementing efficient timers. Applications which want to render at the display's + /// native refresh rate should instead use `Poll` and the VSync functionality of a graphics API + /// to reduce odds of missed frames. WaitUntil(Instant), /// Send a `LoopDestroyed` event and stop the event loop. This variant is *sticky* - once set, /// `control_flow` cannot be changed from `ExitWithCode`, and any future attempts to do so will