To prevent your computer from sleeping during computations, you can adjust the power settings.
Here’s
how to do it on different operating systems:
### Windows
1. **Open Settings**:
- Press `Windows + I` to open Settings.
2. **Go to System**:
- Click on **System** and then select **Power & sleep**.
3. **Adjust Sleep Settings**:
- Under **Sleep**, set the drop-down menus for "When plugged in" and "On battery" to **Never**.
4. **Additional Settings**:
- Click on **Additional power settings** on the right.
- Select **Change plan settings** next to your selected power plan.
- Click on **Change advanced power settings**.
- Expand the **Sleep** section and ensure that **Sleep after** is set to **Never**.
### macOS
1. **Open System Preferences**:
- Click on the Apple logo in the top-left corner and select **System Preferences**.
2. **Go to Energy Saver**:
- Click on **Energy Saver**.
3. **Adjust Sleep Settings**:
- Drag the **Computer Sleep** slider to **Never**.
- Uncheck **Put hard disks to sleep when possible**.
4. **Prevent Display Sleep**:
- You can also adjust the display sleep settings according to your preference.
### Linux
1. **Open Terminal**:
- You can use the terminal or GUI depending on your distribution.
2. **Use Power Settings**:
- For GUI: Go to **Settings** > **Power** and adjust the sleep settings.
- For terminal: You can use command-line tools like `gsettings` to modify sleep settings.
### General Tip
- If you have ongoing computations, consider running them in a dedicated session or terminal window to
avoid accidental sleep triggers. Additionally, using utilities like **Caffeine** (Windows) or
**Amphetamine** (macOS) can help temporarily prevent sleep while specific applications are running.