Answer the question
In order to leave comments, you need to log in
How to correctly assign a string in Power Shell?
When executing the code:
$watch = [System.Diagnostics.Stopwatch]::StartNew()
$watch.Start() #Запуск таймера
Start-Sleep 1
$watch.Stop() #Остановка таймера
$s = "Время выполнения: "
$t = Write-Host $watch.Elapsed #Время выполнения
$s = $s + $t.ToString()
Answer the question
In order to leave comments, you need to log in
$watch = [System.Diagnostics.Stopwatch]::StartNew()
$watch.Start() #Start timer
Start-Sleep 1
$watch.Stop() #Stop timer
Write-Host "Runtime:"$watch.Elapsed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question