From 12b504563307b6bc7e083f0b2b4dc0b88e5e4d04 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 25 Mar 2026 10:11:21 +0100 Subject: [PATCH] Add `Context::time` (#8017) --- crates/egui/src/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index a9151f9cd..a8751bffc 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -1545,6 +1545,11 @@ impl Context { crate::debug_text::print(self, text); } + /// Current time in seconds, relative to some unknown epoch. + pub fn time(&self) -> f64 { + self.input(|i| i.time) + } + /// What operating system are we running on? /// /// When compiling natively, this is