Is there a simple way to time the execution of a command in PowerShell, like the 'time' command in Linux?
I came up with this:
$s=Get-Date; .\do_something.ps1 ; $e=Get-Date; ($e - $s).TotalSeconds
But I would like something simpler like
time .\do_something.ps1
Here's a function I wrote which works similarly to the Unix
time
command:Source: https://gist.github.com/bender-the-greatest/741f696d965ed9728dc6287bdd336874