question about Program Execution Speed
japer
Posts: 105
hello
on Program Execution Speed of the basic stamp module is instruction speed by "command"
or "by line of code" ? or something all together
any help would be helpful
japer
on Program Execution Speed of the basic stamp module is instruction speed by "command"
or "by line of code" ? or something all together
any help would be helpful
japer
Comments
Essentially it's by "command" or function, but there are some exceptions. Since Parallax PBASIC is an interpretive language, one has to realize that there is token fetch time as well, beyond the actual instruction execution time, and that may vary by the particular command or function you are using. So too instructions that access outside entities (SERIN, PULSEIN, SHIFTIN, etc) may depend on those entities themselves, and their particular response/wait times.
You may find this link helpful for empirical timings of some of the more common PBASIC commands, when used on the BS-2 or BS-2X:
··· http://www.emesystems.com/BS2speed.htm
Thanks go to Dr. Tracy Allen for all of that timing work.
Regards,
Bruce Bates
The BS2 runs about 4000 PBasic Instructions Per Second. There are a few instructions (SERIN/SEROUT, SHIFTIN/SHIFTOUT, PAUSE) whose execution time is dependent on the data being sent/recieved or pause time.
So X = X + 1 would be translated into a token for the "+" which would select an addition routine from the run-time EEPROM in the BS2. It would then look up the 'X', look up the '1', do the addition, and store the result in the location X had been using. And this whole process would take around 300 uSec.
that was an excellent link thank you
thanks for both allan and bruces advice
japer