Shop OBEX P1 Docs P2 Docs Learn Events
Code Overhead — Parallax Forums

Code Overhead

hobmailhobmail Posts: 1
edited 2010-02-14 22:15 in Learn with BlocklyProp
How would you know or determine the code overhead?
A book (Robotix with boe-bot) pg. 82-82. On a for..next loop, it says that its takes 1.3ms for the loop to execute,

for counter = 1 to 100
pulout 13, 850
pause 20
next

but on page 83,
it says the code overhead is 1.6 ms,

for counter = 1 to 122
pulsout =13. 850
pulsout 12, 650
pause 20
next

So, which one is which? Is it a constant number regardless of how long the for..next loop subroutine is?

Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-14 22:15
    The best information on Stamp execution time is at www.emesystems.com. Click on the "app-notes" link near the bottom of the page.

    To determine the code overhead, you would need to measure the time to do a large number of these loops including the inner statements and subtract the amount of time to do the same large number of these loops less the inner statements.
Sign In or Register to comment.