Powershell: Measuring Cmdlet Execution Time with Measure-Command

Powershell: Measuring Cmdlet Execution Time with Measure-Command


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 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


Other Languages

This article is also available in the following languages:

Italian (it-IT)

 

Leave a Comment
  • Please add 2 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Luigi Bruno edited Revision 2. Comment: Edited the "Measuring Cmdlet Execution Time" section.

  • Luigi Bruno edited Revision 1. Comment: Edited article's title.

  • Luigi Bruno edited Original. Comment: Added the "Multi Language Wiki Articles" tag. Added the "See Also" section.

Page 1 of 1 (3 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Luigi Bruno edited Original. Comment: Added the "Multi Language Wiki Articles" tag. Added the "See Also" section.

  • Luigi Bruno edited Revision 1. Comment: Edited article's title.

  • Luigi Bruno edited Revision 2. Comment: Edited the "Measuring Cmdlet Execution Time" section.

Page 1 of 1 (3 items)