Does Deepsleep (Standby mode) resets uptime

sleep-wake

Recently, I noticed that my MacBook Pro retina 15" 2015 mid takes a quite long time to wake up from sleep.

Today, I realized that my machine didn't wake up but actually boots up. How did I know that? I've just typed uptime command from a Terminal.app right after the screen shows up.

It says, for example,

1:25 up 3 mins, …

That means, my machine has been running for only 3 minutes and it does not take time before sleep into account.

Then, only one explanation is possible. My machine has been shut down between sleep and wake. And I misunderstood its new boot as wake up

Another rationale is, Deepsleep (Standby mode) resets uptime counter. Huh…

Which do you think more legit?

Best Answer

Your Mac is effectively shut down during the deeper sleep modes. The system state is stored as a file and then the Mac is shut down. On powering back on, the system state is restored from the file.

It is this behaviour that is most likely resetting your uptime results. At the lower UNIX level, most tools will treat the interval as time where your Mac was powered off.

You can learn more about the various sleep states in Apple's OS X: Saving energy with Sleep. Deep sleep is mentioned in the Standby Mode section:

Standby Mode

For Mac computers that are started from an solid-state drive, OS X includes a deep sleep mode known as Standby Mode. Mac computers manufactured in 2013 or later enter standby after one to three hours of regular sleep. A computer with a fully charged battery can remain in standby for up to thirty days without being plugged in to an AC power source.