View Full Version : Elapsed clock cycles

Nico S
10-31-2009, 01:53 AM
Hi there,

Is there anyway to measure the time elapsed between statements ?
Something like CNT on the propeller chip ?

Best regards,
Nico Schoemaker

Mike Green
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.

Nico S
10-31-2009, 03:18 AM
Hi Mike,

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.

Best regards,
Nico Schoemaker

10-31-2009, 03:26 AM
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."

Nico S
10-31-2009, 07:17 PM
Hi erco,

Thanks for the URL, indeed great info !!