I’m back with another set of small helper functions. This time it’s all about timing your script. Sure, it’s not that difficult to do manually – just get the time when it starts, and when it ends, and calculate the running time. It might not look pretty, but it works. With this functions though, it’s even easier!
The two functions are pretty self-explanatory, but let’s give a very simple example of how it can be used:
Write-Host "Script started at $(Start-Timer)" # YOUR CODE GOES HERE Write-Host "Script ended in $(Stop-Timer)"
Easy, eh?