mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Improve the time measurement
This commit is contained in:
@ -10,7 +10,7 @@ param($ParentDir = "$PWD")
|
||||
|
||||
try {
|
||||
"Pulling updates for Git repositories under $ParentDir ..."
|
||||
$StartTime = get-date
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||
set-location "$ParentDir"
|
||||
@ -31,8 +31,7 @@ try {
|
||||
$Count++
|
||||
}
|
||||
|
||||
$Elapsed = new-timeSpan -start $StartTime -end (get-date)
|
||||
write-host -foregroundColor green "OK - pulled updates for $Count Git repositories under $ParentDir in $($Elapsed.seconds) second(s)"
|
||||
write-host -foregroundColor green "OK - pulled updates for $Count Git repositories under $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Reference in New Issue
Block a user