Last active
July 1, 2019 05:45
-
-
Save kdrag0n/2de3a51bb2aac99cfb9003534bed002e to your computer and use it in GitHub Desktop.
WSL 2 boot speed tester written in PowerShell. Usage: Bootbench.ps1 [runs: default = 4]
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
$runs = If ($args.Length > 0) {$args[0]} Else {10} | |
$acc = 0 | |
wsl --shutdown > $null | |
for ($i = 1; $i -le $runs; $i++) { | |
Write-Host -NoNewLine "Run $($i): " | |
$time = (Measure-Command {wsl /bin/true}).TotalMilliseconds | |
"$time ms" | Out-Default | |
$acc += $time | |
wsl --shutdown > $null | |
} | |
$acc /= $runs | |
"" | Out-Default | |
"Average: $acc ms" | Out-Default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment