Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- From: "Arlet" <usenet+5@xxxxxxxxxxxxxxxxx>
- Date: 4 Jan 2007 04:25:21 -0800
John B wrote:
On 04/01/2007 karthikbg wrote:
Hi,
I have some 20 lines of code in assembly .
I have various tasks running. How to calculate the total time of
execution of the code in assembly alone in Vxworks ?
Since any task might get invoked due to various reasons ,
Is putting one printf that prints the current time at the start of
assmbly and another printf at the end of assmbly code that prints the
current time the only way for caculating the assmbly code execution
time ?
Any other ideas.
Thx in advans,
Karthik Balaguru
Calling 'printf()' at the start and end of 20 lines of assembler is
meaningless. The execution time of the library code will far exceed
that of the assembler. Use the old method of counting processor cycles
and adding them up. You'll be surprised at how easy it is. If you don't
have access to a pencil and paper then an abacus is quite useful.
I agree. To get the time for longer/more complicated pieces of code,
you can toggle an IO pin at the beginning and end, and use a scope to
measure the time. If the time isn't constant, a digital scope with
infinite persistence is very handy, while trying to exercise all
possible execution paths.
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.
.
- Follow-Ups:
- References:
- Prev by Date: Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- Next by Date: Optimizations for embedded systems
- Previous by thread: Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- Next by thread: Re: calculation of execution time of assembly code in a realtime program with large number of tasks
- Index(es):
Relevant Pages
|