Learn about Windows PowerShell
Summary: Learn how to measure the time for a Windows PowerShell command to complete.
How can I see how many seconds it takes to retrieve objects from the application log?
(Measure-Command { Get-EventLog application }).totalseconds
hi
"to measure the time for a Windows PowerShell command to complete"
---> it can also measure external application (no PowerShell command)
PS II> (Measure-Command { tasklist /s sv1 }).totalseconds
@Walid Toumi this is excellent. I have never thought of using Measure-Command to measure anything but PowerShell ... it makes perfect sense. Cool. Thank you so much for sharing.
It took me this long.
6.2862714
Does Measure-Command account for other processes running at the same time as the one you are timing? For example the virus scan kicked in while I was timing a long test of several scripts now I'm not sure which ones are valid tests.