itchyny / uptime-rs

Multi-platform uptime library for Rust

Home Page:https://crates.io/crates/uptime_lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-platform uptime library for Rust

CI Status crates.io release MIT License

Example

extern crate uptime_lib;

fn main() {
    match uptime_lib::get() {
        Ok(uptime) => {
            println!("uptime: {} seconds", uptime.as_secs_f64());
        }
        Err(err) => {
            eprintln!("uptime: {}", err);
            std::process::exit(1);
        }
    }
}

Author

itchyny (https://github.com/itchyny)

License

This software is released under the MIT License, see LICENSE.

About

Multi-platform uptime library for Rust

https://crates.io/crates/uptime_lib

License:MIT License


Languages

Language:Rust 74.8%Language:Makefile 25.2%