Re: calculation of execution time of assembly code in a realtime program with large number of tasks




Arlet wrote:

For a software solution, make sure you have an accurate hardware timer,
and take a timestamp at beginning and end, then subtract the values,
and report (through printf, or any other suitable method). Use the same
method to time an empty piece of code to measure the timestamping
overhead.

If the task is amenable, put the assembly code in a loop and run it
millions of times. This makes the calculation take much longer and
then you don't need quite so accurate a timer. Of course, you have to
be careful that you're not changing the basic nature of the processing,
such as reading in lotsa data from main memory that otherwise would
have been in a cache. Anyways, "put a loop around it" is a general
trick for benchmarking.


Cheers,
Brandon Van Every

.



Relevant Pages