Shop Learn
execution time of the instruction — Parallax Forums

execution time of the instruction

I would like to ask if I can find information about the execution time of particular statements anywhere? I mean, among others, the conditional if statement and assigning the pin state to a variable.

Thank you in advance for your answer.


  • ElectrodudeElectrodude Posts: 1,441
    edited 2021-05-25 21:01

    If you don't find the information you're looking for (and I suspect you won't), you can figure it out yourself using a logic analyzer, or any other device that can measure pulse widths (such as a second Basic Stamp). First make a program that does a HIGH immediately followed by LOW on the same pin and measure how long the resulting pulse is. Then, put various instructions between the HIGH and LOW and see how much time the additional instructions add to the baseline pulse width.

  • PublisonPublison Posts: 12,252
    edited 2021-05-25 21:20

    Welcome to the forums!

    You might want to start at Tracy's site:

    and then:

  • Also remember that there are many instructions with variable execution times. For example, PULSIN is affected by the length of the incoming pulse, which can vary.

Sign In or Register to comment.