Of interest is the code that performs the actual measurements. Any other code (such as job implementation or dispatching) that is required to demonstrate the rate tracking is helpful, but not the focus.

Multiple approaches are allowed (even preferable), so long as they can accomplish these goals:

 Run N seconds worth of jobs and/or Y jobs.
 Report at least three distinct times.

Be aware of the precision and accuracy limitations of your timing mechanisms, and document them if you can.

See also: System time, Time a function

html "<table bgcolor=wheat border=1><tr><td align=center colspan=2>Rate Counter</td></tr>
    <tr><td>Run Job Times</td><td>"
    textbox #runTimes,"10",3
 
html "</tr><tr><td align=center colspan=2>"
     button #r,"Run", [runIt]
html "        "
     button #a, "Average", [ave]
html "</td></tr></table>"
wait
 
[runIt]
runTimes = min(10,val(#runTimes contents$()))
count = count + 1
print "-------- Run Number ";count;" ----------------"
print "Run jobs";runTimes;" times, reporting each"
 
for i = 1 to runTimes
    ' -----------------------------------------------------------------
    ' Normally we use a RUN() command to run another program
    ' but for test pruporse we have a routine that simply loops a bunch
    ' -----------------------------------------------------------------
    begTime  = time$("ms")
    theRun   = bogusProg()
 
    endTime  = time$("ms")
    lapsTime = endTime - begTime
    print "Job #";i;" Elapsed time, ms ";lapsTime;" ";1000/lapsTime; " ticks per second"
next
aveTime    = (endTime-startTime)/runTimes
totAveTime = totAveTime + aveTime
print "Average time, ms, is ";aveTime;" "; 1000/((endTime-startTime)/runTimes); " ticks per second"
wait
 
[ave]
print "---------------------------------"
print "Total average time:";aveTime/count
 
function bogusProg()
    for i = 1 to 10000
        sini = sini + sin(i)
        tani = tani + tan(i)
        cpsi = cosi + cos(i)
    next
end function 