PDA

View Full Version : calculating speed of a loop



EDWARD
- 5th June 2005, 20:16
THIS MY BE A SIMPLE QUestion.

lets say i have a loop like the one below. how long would it take for x=65,000. i have a 4 mhz proccessor (actually 4.19 i use HS)

x=0

loop:
x = x+1
goto loop

basiically i need a have a variable count for 500 ms. how high would it have to count? am i goning to need to nest a counter? is it 1 assembly instruction for every clock cycle?

Darrel Taylor
- 5th June 2005, 20:34
Edward,

Take a look at this thread. You can easily measure the actual loop time, and adjust it accordingly.

http://www.picbasic.co.uk/forum/showthread.php?t=365

HTH,
 Darrel