https://github.com/itchyny/uptime-rs
Multi-platform uptime library for Rust
https://github.com/itchyny/uptime-rs
rust rust-library uptime
Last synced: 5 months ago
JSON representation
Multi-platform uptime library for Rust
- Host: GitHub
- URL: https://github.com/itchyny/uptime-rs
- Owner: itchyny
- License: mit
- Created: 2017-10-08T03:52:07.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T23:40:33.000Z (over 1 year ago)
- Last Synced: 2025-04-16T01:51:40.496Z (6 months ago)
- Topics: rust, rust-library, uptime
- Language: Rust
- Homepage: https://crates.io/crates/uptime_lib
- Size: 27.3 KB
- Stars: 19
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multi-platform uptime library for Rust
[](https://github.com/itchyny/uptime-rs/actions?query=branch:main)
[](https://crates.io/crates/uptime_lib)
[](https://github.com/itchyny/uptime-rs/releases)
[](https://github.com/itchyny/uptime-rs/blob/main/LICENSE)## Example
```rust
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.