Crates.io | nosleep |
lib.rs | nosleep |
version | 0.2.1 |
source | src |
created_at | 2022-04-21 19:54:12.227692 |
updated_at | 2022-11-20 17:01:53.107397 |
description | Block power save mode cross platform |
homepage | https://github.com/pevers/nosleep |
repository | https://github.com/pevers/nosleep |
max_upload_size | |
id | 571854 |
size | 4,714 |
Cross-platform library to block the power save function in the OS.
use nosleep::{NoSleep, NoSleepType};
let mut nosleep = NoSleep::new().unwrap();
nosleep
.start(NoSleepType::PreventUserIdleDisplaySleep)
.unwrap();
std::thread::sleep(std::time::Duration::from_millis(180_000));
nosleep.stop().unwrap(); // Not strictly needed