Jump to content

Rate counter: Difference between revisions

no edit summary
(→‎{{header|XPL0}}: added zkl)
No edit summary
Line 1,032:
<pre>1.761 sec
-> "a"</pre>
 
=={{header|PowerShell}}==
<lang PowerShell>
[datetime]$start = Get-Date
 
[int]$count = 3
 
[timespan[]]$times = for ($i = 0; $i -lt $count; $i++)
{
Measure-Command {0..999999 | Out-Null}
}
 
[datetime]$end = Get-Date
 
$rate = [PSCustomObject]@{
StartTime = $start
EndTime = $end
Duration = ($end - $start).TotalSeconds
AverageRunTime = ($times.TotalSeconds | Measure-Object -Average).Average
}
 
$rate | Format-List
</lang>
{{Out}}
<pre>
StartTime : 10/27/2016 3:33:16 PM
EndTime : 10/27/2016 3:33:30 PM
Duration : 13.9062588
AverageRunTime : 4.63301593333333
</pre>
 
=={{header|PureBasic}}==
308

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.