#active #system #amount #find #system-time #information #spent

active-time

A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping

3 releases

0.1.2 Mar 9, 2023
0.1.1 Mar 8, 2023
0.1.0 Mar 8, 2023

#2 in #spent

MIT/Apache

4KB

active-time

crates.io docs.rs

A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping.

Windows

This currently only works on Windows and uses the QueryUnbiasedInterruptTime method to query the current "ticks", which represent 100ns each.

Example

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.

Dependencies

~175KB