MCPcopy Create free account
hub / github.com/Roy3838/Observer / format_duration

Method format_duration

cli/src/runner.rs:13–27  ·  view source on GitHub ↗

Format duration as human-readable string

(&self)

Source from the content-addressed store, hash-verified

11impl CommandResult {
12 /// Format duration as human-readable string
13 pub fn format_duration(&self) -> String {
14 let secs = self.duration.as_secs();
15
16 if secs < 60 {
17 format!("{}s", secs)
18 } else if secs < 3600 {
19 let mins = secs / 60;
20 let remaining_secs = secs % 60;
21 format!("{}m {}s", mins, remaining_secs)
22 } else {
23 let hours = secs / 3600;
24 let mins = (secs % 3600) / 60;
25 format!("{}h {}m", hours, mins)
26 }
27 }
28}
29
30/// Run a command with inherited stdio and return the result

Callers 6

send_sms_notificationFunction · 0.80
send_call_notificationFunction · 0.80
send_email_notificationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected