Quote:
Originally Posted by apalrd
The best metric we can get (in LabVIEW at least) is the RT Get CPU Loads block.
|
If there's a microsecond (or better) system clock, you can read it at the start (ts) and end (te) of each realtime task. These can be used to measure the margin and scheduling accuracy for each task.
Code:
// start of task
tmp=systemClock();
period=tmp-ts;
margin=tmp-te;
ts=tmp;
//
// task code goes here
//
te=systemClock();
// end of task