Function mprober_lib::format_duration
source · pub fn format_duration(duration: Duration) -> StringExpand description
Format a Duration to a string. The string would be like 4 hours, 39 minutes, and 25 seconds.
use mprober_lib::uptime;
let uptime = uptime::get_uptime().unwrap();
println!("{}", mprober_lib::format_duration(uptime.total_uptime))