If you want to measure the execution time of the code inside your task, you could try to separate the code in question into separately callable subroutines and then measure the performance of each individual subroutine via the vxWorks timexLib
, see for example its timexN()
method.
timexN()
is very accurate. If you can modularize your code to allow per-subroutine benchmarking, your design might benefit overall, but it may not always be possible.
If you cannot perform this type of modular testing, and need a timer that is finer than the tickLib
, your options can depend on your target platform. In the sysLib.c
file of your BSP you will typically find a routine sysUsDelay()
that uses a time of much higher detail than tickGet()
. Look for code that reads a "Time Base Lower Register" tick count, which increments close to the CPU speed. Unfortunately, the details are specific to your target platform (CPU, ..). Still, as long as you stay on the same target, you can look in there how to obtain that higher resolution tick counter for your execution time analysis.