Crates.io | active-time |
lib.rs | active-time |
version | 0.1.2 |
source | src |
created_at | 2023-03-08 19:35:41.84941 |
updated_at | 2023-03-09 05:36:52.698285 |
description | A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping. |
homepage | |
repository | https://github.com/M1ngXU/active-time |
max_upload_size | |
id | 805036 |
size | 4,435 |
A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping.
This currently only works on Windows and uses the QueryUnbiasedInterruptTime
method to query the current "ticks", which represent 100ns
each.
let active_time: Duration = active_time::active_time()?;
This prints the current active time. Check out the example for more information and also a comparation with Instant::elapsed
when hibernating Windows while the program is running.