Learn about Windows PowerShell
Summary: Use Windows PowerShell to find the total CPU time of a process.
How can I return a timespan that represents the total CPU time of a process?
Use the Get-Process cmdlet and select the TotalProcessorTime property:
PS C:\> (gps excel).totalprocessortime
Days : 0
Hours : 0
Minutes : 0
Seconds : 4
Milliseconds : 524
Ticks : 45240290
TotalDays : 5.23614467592593E-05
TotalHours : 0.00125667472222222
TotalMinutes : 0.0754004833333333
TotalSeconds : 4.524029
TotalMilliseconds : 4524.029
Love these new powertips. They are great learning tools that allows me to incorporate them in my scripts that I am writing. Thank you very much.
@John I am glad you love the new PowerTips. I was not certain how well they would do when I first started writing them. I now have several months worth of PowerTips, and they have their own tags. You can see only the PowerTips here: blogs.technet.com/.../powertip