Created
February 17, 2016 14:36
-
-
Save trstringer/0160591d2104367d036a to your computer and use it in GitHub Desktop.
Compare the startup time of VS Code and Sublime
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
$codeProcessName = "code" | |
$sublimePath = "C:\Program Files\Sublime Text 2\sublime_text.exe" | |
$sublimeProcessName = "sublime_text" | |
function StartAndTimeProcess { | |
param ( | |
[string]$processName, | |
[string]$processPath | |
) | |
$before = Get-Date | |
Start-Process $processPath | |
while ($true) { | |
if (Get-Process $processName -ErrorAction SilentlyContinue | | |
Measure-Object | | |
Select-Object -ExpandProperty count) { | |
$after = Get-Date | |
break | |
} | |
} | |
return ($after - $before).TotalMilliseconds | |
} | |
"Code start duration :: $(StartAndTimeProcess $codeProcessName $codeProcessName) ms" | |
"Sublime start duration :: $(StartAndTimeProcess $sublimeProcessName $sublimePath) ms" | |
<# | |
Code start duration :: 95.1485 ms | |
Sublime start duration :: 8.5054 ms | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment