Hi, all
I want to measure time accurately so that I can derive frame rate of my
encoder. But the clock() function does not work well in CCS. So now I can
only use time() function that only gets time in seconds. Any other ways to
measure time accurately?
Thanks
Yong
|
How to measure time accurately
Started by ●June 23, 2004
Reply by ●June 25, 20042004-06-25
Hi Yong,
Have you tried using BIOS STS for this?
I've used STS module a lot for this kind of benchmarking, and found it
helpful for gathering data over multiple iterations for getting max and average
time data. You can use the STS module with the CLK module as follows
:-
#include <std.h>
#include <sts.h>
#include
<clk.h>
extern far STS_Obj
myStsTime; // [Create an STS Obj in the CDB file] externally
reference this object
...
STS_set(&myStsTime,
CLK_gethtime()); // Get the value of the high resolution timer
(cpuclk/4 or /8), put this in an STS Obj process();
// Function or code to measure
STS_delta(&myStsTime, CLK_gethtime()); // Get the value of
the high resolution timer (cpuclk/4 or /8), take diff and put in STS
Obj
The other nice thing about this is that it
doesn't stop the dsp to grab the time, and hence should work in your
real-time system.
Hope this helps,
raj
|