about summary refs log tree commit diff
path: root/src/modules/time.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-11-14 02:35:53 -0700
committerIrene Knapp <ireneista@irenes.space>2026-11-14 02:35:53 -0700
commit815fb567bdfdbc3901148a4b9f49fd42a56c4f27 (patch)
treea0fdd871ccf943e1b3d0247b01a359bcec48f078 /src/modules/time.rs
parentd0c5a0eeec74de59a4919a42412d41fafb2593e3 (diff)
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
Diffstat (limited to 'src/modules/time.rs')
-rw-r--r--src/modules/time.rs8
1 files changed, 7 insertions, 1 deletions
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<Duration> {
+    Some(Duration::from_millis(1000))
+  }
 }