Shop OBEX P1 Docs P2 Docs Learn Events
FOR...NEXT loop overhead time — Parallax Forums

FOR...NEXT loop overhead time

Casey_SCUCasey_SCU Posts: 19
edited 2006-07-13 18:27 in Learn with BlocklyProp
In chapter 2 of Robotics with the Boe-Bot, v. 2.2 on page 82-83 there is a section about how long it takes to execute a given set of commands. I have expanded the commands in a For...Next loop and was wondering how to compute the time it takes to run the loop.

My main for..next loop consists of only two commands, a GOSUB command. The sub program then has a for...next loop with an imbedded if...then statement.

In the Robotics student guide, for one command it lists the code overhead as 1.3ms, but with two pulsout commands the code overhead is 1.6ms.

Is there a scaling factor used to determine the code overhead based on the number of commands within the For...next loop?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-13 18:27
    Casey -

    The following link contains most of the available information on PBASIC Instruction execution timings:
    http://www.emesystems.com/BS2speed.htm

    Thanks go to Dr. Tracy Allen for his work in compiling that information.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.