Windows – How long has a process has been running (uptime)

processwindows 7

Situation

I have been running a process on my laptop doing some heavy processing for the last few days. Every night I hibernate my computer, and boot it up in the morning.

What I Seek

I'm looking for a way to determine how long this process has been running.

What I've Tried

  • Using PowerShell I was able to find the start time of my process.

    Get-Process | Select-Object id, starttime, name |Sort-Object name
    

    However this is just the start time. I would like to know how long my process has been actively running. Not the time since it began running.

    6/13/2014 9:15:43 AM -> NOW (6/24/2014 10:38:45 AM) = 11 Days 1 Hour 23 Minutes 0 Seconds.

  • Using Task Manager, under the Processes tab I've looked at the CPU Time column, which is useful, and probably give the best statistical number for "how much time it takes to run this program", it however is not how long the process has been running.

    363:47:35

Edit: I don't think I was very clear, that I know how to get the elapsed time since this process began, however that isn't the amount of time the process has been running because I hibernate my computer, which basically freezes it. So I'm roughly looking for elapsed time since beginning process minus time spent hibernating between now and when the process began.

Best Answer

In PowerShell:

PS C:\> New-TimeSpan -Start (get-process notepad).StartTime

Found this command on TechNet Blogs.

Related Question