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

 
Print "Rate counter"
print "Precision: system clock, ms ";
t0=time$("ms")
while time$("ms")=t0    'busy loop till click ticks
wend
print time$("ms")-t0
print
 
Print "Run jobs N times, report every time"
Print "After that, report average time"
N=10
t00=time$("ms")
for i = 1 to 10
    scan
    t0=time$("ms")
    'any code we want to measure goes here
    res = testFunc()
    'end of measured code
    t1=time$("ms")
    ElapsedTime = t1-t0
    print "Job #";i;" Elapsed time, ms ";ElapsedTime, 1000/ElapsedTime; " ticks per second"
next
print "---------------------------------"
print "Average time, ms, is ";(t1-t00)/N,  1000/((t1-t00)/N); " ticks per second"
 
 
print
print "Run jobs for not less then N seconds (if time up, it'll finish last job)"
print "After that, report average time"
 
NSec=5
i = 0
t00=time$("ms")
while time$("ms")<t00+NSec*1000
    scan
    i = i+1
    t0=time$("ms")
    'any code we want to measure goes here
    res = testFunc()
    'end of measured code
    t1=time$("ms")
    ElapsedTime = t1-t0
    print "Job #";i;" Elapsed time, ms ";ElapsedTime,  1000/ElapsedTime; " ticks per second"
wend
print "---------------------------------"
print "Average time, ms, is ";(t1-t00)/i,  1000/((t1-t00)/i); " ticks per second"
 
end
 
function testFunc()
    s=0
    for i = 1 to 30000
        s=s+sin(i)/30000
    next
    testFunc = s
end function 
 