mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Use New-TimeSpan to calculate total elapsed time
This commit is contained in:
commit
9bbc97c981
9
vendor/profile.ps1
vendored
9
vendor/profile.ps1
vendored
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user