Function mprober_lib::format_duration
source · [−]Expand description
Format a Duration to a string. The string would be like 4 hours, 39 minutes, and 25 seconds.
extern crate mprober_lib;
use mprober_lib::uptime;
let uptime = uptime::get_uptime().unwrap();
println!("{}", mprober_lib::format_duration(uptime.total_uptime))