Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Measuring Cmdlet Execution Time
If you’ve ever wondered how long it takes to perform a specific task then the Measure-Command cmdlet is exactly what you’ve been looking for: it enables you to measure the running time of a command or script down to the millisecond. Simply call the cmdlet you want to profile, using the command or script to be run as the cmdlet parameter inside curly braces.
For example, you can measure the time it takes to get a list of all the running process on the local computer (or on a remote one) by means of the Get-Process cmdlet: open the Powershell window and execute the following command
PS C:\Users\Luigi\Measure-Command {Get-Process}
You'll get an output like the following (captured from an English Windows 7 with Powershell version 3)
See Also
- Measure-Command (TechNet Library)
- Using the Measure-Command cmdlet (TechNet Library)
- PowerShell Portal
- Wiki: Portal of TechNet Wiki Portals
References
- PowerTip: Measure Performance of PowerShell Command
- PowerTip: Measure the Time for a Command to Complete
- Analyzing PowerShell Script Files
- PowerTip: Time How Long PowerShell Command Takes to Complete
Other Languages
This article is also available in the following languages: