View Full Version : Elapsed clock cycles
10-31-2009, 01:53 AM
Is there anyway to measure the time elapsed between statements ?
Something like CNT on the propeller chip ?
10-31-2009, 03:01 AM
Typically the way this sort of thing is measured is by isolating the statement of interest and putting it in a loop that executes it a specific number of times (like 1000), preceding and following the loop with a PULSOUT statement and measuring the elapsed time using some kind of external timer. By using a large loop, the fixed overhead of the loop and the PULSOUT statements becomes a small part of the overall time. You can also remove the statement of interest from the loop and remeasure the total time, then subtract that from the measurement with the statement of interest in place.
10-31-2009, 03:18 AM
Thanks a lot for your reply.
I was trying to get rid of the PAUSE commands, used for example in controling a servo(s), to free up some processing time.
Anyway thanks again.
Have·a look at Tracy Allen's great info at http://www.emesys.com/BS2speed.htm to estimate command execution speeds.
·"If you build it, they will come."
10-31-2009, 07:17 PM
Thanks for the URL, indeed great info !!