Is there a built-in way to measure execution time of a command on the Windows command line?
Depending on the version of Windows you're using, just running bash
will put you into Bash mode. This will allow you to use a bunch of commands that are not available on PowerShell directly (like the time
command). Timing your command is now as easy as executing:
# The clause (without the angle brackets) denotes the command you want to run.
$ time
Note: You can easily quit from Bash mode and return back into your mainstream shell by running
exit
while in Bash mode.
This worked for me perfectly (Windows 10) after trying out other methods (like Measure-Command
) which sometimes produce undesired stats. Hope this works for you as well.