-
-
Save IISResetMe/0168974181cf1527d049c8fecabb2db7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # start timer | |
| $timer = [System.Diagnostics.Stopwatch]::StartNew() | |
| # wait at least 100ms | |
| Start-Sleep -Milliseconds (Get-Random -Minimum 100 -Maximum 1500) | |
| # stop timer | |
| $timer.Stop() | |
| $time = $timer.Elapsed.TotalSeconds | |
| # format seconds | |
| $timestamp = '{0:00.000}' -f $time | |
| # use resulting value in expandable string | |
| "$($timestamp): Something happened" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment