Keep Julia Awake: NoSleep.jl

Evgeny Metelkin

2025-10-04

Cover

When you run long Julia simulations or heavy computations on a laptop, you don't want your machine to fall asleep in the middle of the job.
On Windows, macOS, or Linux, the system may suspend itself even if Julia is still crunching numbers — leading to wasted time, broken HTTP calls, or stalled jobs.

This is the reason NoSleep.jl exists: a lightweight cross-platform Julia package that prevents your machine from falling asleep during long computations.

How it works

Each backend is safe: once your block finishes (or Julia exits), the inhibitor is released automatically.

Usage

Block form

using NoSleep

with_nosleep() do
    # Your long computation
end

Keep the display awake too

with_nosleep(; keep_display=true) do
    # Your long computation
end

Notes & Side-effects

License: CC-BY-4.0