Function mprober::format_duration[][src]

pub fn format_duration(duration: Duration) -> String

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))