From 815fb567bdfdbc3901148a4b9f49fd42a56c4f27 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 14 Nov 2026 02:35:53 -0700 Subject: return a sleep duration to the event loop this isn't immediately useful, but it will be when threading is added... Force-Push: yes Change-Id: I7abc35826d4ff4a7a63d57f4f7f5e0e0461d23d9 --- src/modules/time.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/modules/time.rs') diff --git a/src/modules/time.rs b/src/modules/time.rs index 61a0cf8..8f6f417 100644 --- a/src/modules/time.rs +++ b/src/modules/time.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use time::OffsetDateTime; use time::format_description::{ FormatDescriptionV3, parse_owned }; @@ -18,10 +20,14 @@ impl TimeModule { TimeModule { time_format } } - pub fn format(&self) -> String { + pub fn format(&mut self) -> String { let time = OffsetDateTime::now_local().unwrap(); time.format(&self.time_format).unwrap() } + + pub fn sleep_duration(&self) -> Option { + Some(Duration::from_millis(1000)) + } } -- cgit 1.4.1