Why is the system uptime too long despite shutdown?

The Task Manager displays a system uptime of about 3 days and 1 hr

I have used the machine for just 10 hrs this week.

The difference is normal.

  • The Windows system uptime is the difference between the current time and the system boot time.

  • It doesn't subtract any time the system has spend in a sleep or hibernate state.

Task Manager shows a piece of information called "Up time". How is this value calculated, and why doesn't it agree with the value reported by Get­Tick­Count/Get­Tick­Count64?

Task Manager calculates "up time" by subtracting the system boot time from the current time. In other words, it is misnamed; it really should be called time since system was started. It doesn't subtract out the time when the computer was in sleep or hibernation.

The tick count, on the other hand, counts only time that elapses while the computer is on.

Source How does Task Manager compute Up Time, and why doesn't it agree with GetTickCount? by Raymond Chen (Principal Software Design Engineer at Microsoft).


How do I get the uptime since the last sleep or hibernate?

setx HardwareUptime "powershell.exe -nologo -command Write-Host $('Uptime since hardware boot: {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -InstanceId 27 -Newest 1).TimeGenerated)); Write-Host $('Uptime since system resumed: {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -Source 'Microsoft-Windows-Power-Troubleshooter' -Newest 1).TimeGenerated));"

I've modified the command a little bit to be more explicit and give you both pieces of information:

  • Elapsed time since Windows booted (either after a hybrid shutdown, full shutdown or simple reboot or hibernation).

  • Elapsed time since Windows resumed execution (after returning from sleep mode).

NOTE: If the system didn't sleep in between, both times will be the same.

Source Windows 8 reports WRONG uptime (possibly total Hybrid-Boot uptime) by asm00


I have tried shutting down for a few hours but still found it unchanged.

You have Hybrid Boot enabled.

The legacy definition for uptime is the time that the computer has been running since the kernel initialized itself. Since hybrid boot is just a special type of suspend (there was previously suspend to RAM and Hibernate), it doesn't count as "shutting down", because the same instance of the Windows kernel is used.

Source comment to Windows 8 reports WRONG uptime (possibly total Hybrid-Boot uptime) by allquixotic

Hybrid Boot is a new feature in Windows 8 that takes the Hibernate feature we all know and love and improves upon it to bring us faster boot times. In your PC you have multiple sessions, more specifically you have session 0 which is reserved for the kernel session and session 1 which is normally your user session. In traditional implementations of hibernation when you click hibernate your PC takes everything that it currently has in memory (RAM) and writes it to the hiberfil.sys file on your hard drive, this includes both session 0 and session 1 data.

With Hybrid Boot, instead of hibernating both sessions it only hibernates session 0, it then closes your user session. So now when you start your PC back up, it reads session 0 from hiberfil.sys and puts it back into memory, and starts a new user session for you. The result is dramatically faster boot times, with no effect on our user sessions.

Source How to Do a Full Shutdown in Windows 8 Without Disabling Hybrid Boot

The link includes instructions on how to do a full shutdown.


Further reading

The Old New Thing: Practical Development Throughout the Evolution of Windows by Raymond Chen (Principal Software Design Engineer at Microsoft).

Tags:

Windows

Uptime