Skip to main content

parse_uptime

Function parse_uptime 

Source
pub fn parse_uptime(text: &str) -> Option<f64>
Expand description

What: The seconds since boot in /proc/uptime text, its first field. Why: The start is now - uptime + ticks / USER_HZ.

In TS you’d write (pseudocode):

Number(text.split(' ')[0])