How it works...
The cmdlet that helps find the total runtime of any command or a script block is Measure-Command. While this cmdlet can take PSObject as input, the convention here is to use the Expression parameter. This parameter accepts a script block as input, which is what we pass to it, in our case. The cmdlet evaluates for how long the script block ran, and shows us the output as a System.TimeSpan object.
Now, on to the point that your friend mentioned you taking longer than 200 ms to merely write the properties. I was once tasked with creating a script that performed some filtration on Active Directory objects based on a couple of properties. We observed that the script took about 25 minutes to run in that environment. After some minor ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access