Skip to content

Instantly share code, notes, and snippets.

@trstringer
Created February 17, 2016 14:36
Show Gist options
  • Save trstringer/0160591d2104367d036a to your computer and use it in GitHub Desktop.
Save trstringer/0160591d2104367d036a to your computer and use it in GitHub Desktop.
Compare the startup time of VS Code and Sublime
$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