Rate counter: Difference between revisions
→{{header|Raku}}: raku got faster in ten years, so bump difficulty
(→{{header|Raku}}: raku got faster in ten years, so bump difficulty) |
|||
Line 1,866:
sub factorial($n) { (state @)[$n] //= $n < 2 ?? 1 !! $n * factorial($n-1) }
runrate
runrate
{{out}}
<pre>Start time:
End time:
Elapsed time:
Rate:
Start time:
End time:
Elapsed time: 0.
Rate:
</pre>
The <tt>Instant</tt> type in Perl 6 is defined to be based on TAI seconds, and represented with rational numbers that are more than sufficiently accurate to represent your clock's accuracy. The actual accuracy will depend on your clock's accuracy (even if you don't have an atomic clock in your kitchen, your smartphone can track various orbiting atomic clocks, right?) modulo the vagaries of returning the atomic time (or unreasonable facsimile) via system calls and library APIs.
|