Last active
May 28, 2021 14:48
-
-
Save trnktms/90457b9ab5dea7ea1fb4d198875581d0 to your computer and use it in GitHub Desktop.
This file contains 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
while ($true) { | |
$measuredTime = (Measure-Command -Expression { Invoke-WebRequest -Uri www.google.com }).TotalMilliseconds; | |
If ($measuredTime -gt 1000) { | |
$color = "red" | |
} | |
Else { | |
$color = "green" | |
} | |
Write-Host (Get-Date -Format "HH:mm:ss.ffff"): $measuredTime -ForegroundColor $color | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the one-liner for PS console: