How to measure execution time for a portion of VxWorks code using VxWorks 5.5 and Tornado 2
void my_task() { UINT32 timestamp1, timestamp2; double tsperiod, delta_time; sysTimestampEnable(); tsperiod = (double)sysTimestampPeriod(); timestamp1 = sysTimestamp(); /* execute some code */ timestamp2 = sysTimestamp(); delta_time = (double)(timestamp2 - timestamp1)/tsperiod/sysClkRateGet(); exit(0); }Technorati tags: vxworks
Comments
sysTimestampPeriod returns the number of ticks the timer counts before resetting - I think sysTimestampFreq should be used to get the frequency in ticks per second in order to calculate the delta time.
Hello, please let me know if you have an example code for multiplication the 2 floating point vectors using Altivec-MPC7457 and VxWorks-6.2.
Thank you in advance.
Elia
That is incorrect, the line should read: delta_time = (double)(timestamp2 - timestamp1)/sysTimestampFreq();