Powershell - Measure-Command Cmdlet



Cmdlet

Measure-Command cmdlet is used to meaure the time taken by script or command.

In these example, we're see the Measure-Command cmdlet in action.

Example

In this example, we'll show how to measure time of Get-EventLog command to log an event in PowerShell event log.

Measure-Command { Get-EventLog "Windows PowerShell" }

Output

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 50
Ticks             : 506776
TotalDays         : 5.86546296296296E-07
TotalHours        : 1.40771111111111E-05
TotalMinutes      : 0.000844626666666667
TotalSeconds      : 0.0506776
TotalMilliseconds : 50.6776 
powershell_advanced_cmdlets.htm
Advertisements