How to time how long something takes to run in Windows

It can be useful to time how long certain commands take to run. With Powershell, you can do this easily using the Measure-Command cmdlet:

Measure-Command { ping google.com | Out-Default }

Simply replace ping google.com with whatever you want to time, and off you go. You’ll get a readout similar to this when your command finishes executing with details of how long it took:

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 3
Milliseconds      : 116
Ticks             : 31167663
TotalDays         : 3.60736840277778E-05
TotalHours        : 0.000865768416666667
TotalMinutes      : 0.051946105
TotalSeconds      : 3.1167663
TotalMilliseconds : 3116.7663

Something to add?

This site uses Akismet to reduce spam. Learn how your comment data is processed.