mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-11 07:59:07 +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
|
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands
|
# !!! 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
|
# Compatibility with PS major versions <= 2
|
||||||
if (!$PSScriptRoot) {
|
if (!$PSScriptRoot) {
|
||||||
@ -224,5 +224,8 @@ if ( $(Get-Command prompt).Definition -match 'PS \$\(\$executionContext.SessionS
|
|||||||
Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly
|
Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
$CMDER_INIT_END = $(Get-Date -UFormat %s)
|
$CMDER_INIT_END = Get-Date
|
||||||
Write-Verbose "Elapsed Time: $(get-Date) `($($CMDER_INIT_END - $CMDER_INIT_START) total`)"
|
|
||||||
|
$ElapsedTime = New-TimeSpan -Start $CMDER_INIT_START -End $CMDER_INIT_END
|
||||||
|
|
||||||
|
Write-Verbose "Elapsed Time: $($ElapsedTime.TotalSeconds) seconds total"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user