Rate counter: Difference between revisions
m
→{{header|Mathematica}}
(Rate counter en BASIC256) |
|||
Line 1,204:
</lang>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
The first parameter for both of these functions can be any program code.
<lang>jobRateCounted[fn_,Y_Integer]:=First[AbsoluteTiming[Do[fn,{Y}]]/Y;
SetAttributes[jobRateCounted,HoldFirst]
jobRatePeriod[fn_,time_]:=Block[{n=0},TimeConstrained[While[True,fn;n++]];n/time];
SetAttributes[jobRatePeriod,HoldFirst]</lang>
=={{header|Nim}}==
|