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

include c:\cxpl\codes;               \intrinsic 'code' declarations
int N, I, T0, Time;
[for N:= 1, 3 do
    [T0:= GetTime;
    for I:= 1 to 100 do
        [while port($3DA) & $08 do [];  \wait for vertical retrace to go away
        repeat until port($3DA) & $08;  \wait for vertical retrace signal
        ];
    Time:= GetTime - T0;
    IntOut(0, Time);  Text(0, " microseconds for 100 samples = ");  
    RlOut(0, 100.0e6/float(Time));  Text(0, "Hz");  CrLf(0);
    ];
]