Rate counter: Difference between revisions

Added Chipmunk Basic
(→‎{{header|Raku}}: raku got faster in ten years, so bump difficulty)
(Added Chipmunk Basic)
 
(2 intermediate revisions by 2 users not shown)
Line 551:
return 0;
}</syntaxhighlight>
 
=={{header|Chipmunk Basic}}==
{{works with|Chipmunk Basic|3.6.4}}
<syntaxhighlight lang="vbnet">100 cls
110 for i = 1 to 3
120 gosub 170
130 next i
140 i = 200
150 gosub 170
160 end
170 'function timeit
180 iter = 0
190 starter = timer
200 while true
210 iter = iter+1
220 if timer >= starter+i then exit while
230 wend
240 print iter;" iteraciones en ";i;" milisegundo";
250 if i > 1 then print "s" else print ""
260 return</syntaxhighlight>
 
=={{header|Common Lisp}}==
Line 801 ⟶ 821:
theJob()
})</syntaxhighlight>
 
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=RYzLCsIwEEX3+YpDF+IDyygUV+m/hDZCIA9JB8G/l4SKm8sc5ty7lFgqDxFTMi6H5NQbYIne1XZUt3KxyHhvlMrbMwmTdCnUJfqmNArPLs/7c+9aOo0tFMv22TQkvxdUmPnprxqychMRzhyVKyonDgykbfiPCBY1Pq/mCw== Run it]
<syntaxhighlight>
color 700
on animate
clear
rad += 0.2
move 50 50
circle rad
if rad > 50
rad = 0
.
t = systime
if t0 > 0
print 1000 * (t - t0) & " ms"
.
t0 = t
end
</syntaxhighlight>
{{out}}
<pre>
17.00 ms
17.00 ms
16.00 ms
.
.
</pre>
 
=={{header|Erlang}}==
Line 2,407 ⟶ 2,455:
 
Note that, in an attempt to obtain more meaningful times, I've called the function 1 million times compared to just one in the Kotlin example which uses a more accurate timer.
<syntaxhighlight lang="ecmascriptwren">var cube = Fn.new { |n| n * n * n }
 
var benchmark = Fn.new { |n, func, arg, calls|
2,122

edits