Use New-TimeSpan to calculate total elapsed time

This commit is contained in:
David Refoua 2022-12-20 10:19:00 +03:30 committed by GitHub
commit 9bbc97c981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
vendor/profile.ps1 vendored
View File

@ -5,7 +5,7 @@
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands
$CMDER_INIT_START = $(Get-Date -UFormat %s)
$CMDER_INIT_START = Get-Date
# Compatibility with PS major versions <= 2
if (!$PSScriptRoot) {
@ -224,5 +224,8 @@ if ( $(Get-Command prompt).Definition -match 'PS \$\(\$executionContext.SessionS
Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly
}
$CMDER_INIT_END = $(Get-Date -UFormat %s)
Write-Verbose "Elapsed Time: $(get-Date) `($($CMDER_INIT_END - $CMDER_INIT_START) total`)"
$CMDER_INIT_END = Get-Date
$ElapsedTime = New-TimeSpan -Start $CMDER_INIT_START -End $CMDER_INIT_END
Write-Verbose "Elapsed Time: $($ElapsedTime.TotalSeconds) seconds total"