Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.42 KB

README.md

File metadata and controls

25 lines (20 loc) · 1.42 KB

nosleep

Continuous Integration (macOS) Continuous Integration (Linux) Continuous Integration (Windows) license version Crates.io

Cross-platform library to block the power save function in the OS.

use nosleep::{NoSleep, NoSleepTrait};
let mut nosleep = NoSleep::new().unwrap();
nosleep
    .prevent_display_sleep() // or prevent_system_sleep()
    .unwrap();
std::thread::sleep(std::time::Duration::from_millis(180_000));
nosleep.stop().unwrap(); // Not strictly needed

Supported Platforms

Platform Status Tested
Linux ✔️ ✔️
macOS ✔️ ✔️
Windows ✔️ ✔️
iOS
Android