Another bizarre question...
Smitty
Posts: 9
This code...
Should run NO FASTER than 66 times per second with no input. There is a 15 ms timeout value... 1000ms / 15 ms = 66.6... and that doesn't even consider the time to execute all of the other instructions in the "Do some stuff" sections...
So when I let it run for 10 seconds, why does it print over 4000 dots in the console? I cut and pasted the output into notepad, saved it as a text file, and checked the file size in bytes... I tried various run times to get a better average... they all show that a dot is printed roughly every .0029 seconds.
How can this loop run in less than 3 ms per iteration when it should take 15 ms just to timeout?
(This could explain some funky timing issues with SERIN...)
MAIN: DEBUG "." 'check for input SERIN 16, 240, 15, TIMEOUT, [noparse][[/noparse]WAIT("*"), STR cmdIn\2] 'do some stuff GOTO AFTER_INPUT TIMEOUT: 'do some stuff AFTER_INPUT: 'do some stuff GOTO MAIN
Should run NO FASTER than 66 times per second with no input. There is a 15 ms timeout value... 1000ms / 15 ms = 66.6... and that doesn't even consider the time to execute all of the other instructions in the "Do some stuff" sections...
So when I let it run for 10 seconds, why does it print over 4000 dots in the console? I cut and pasted the output into notepad, saved it as a text file, and checked the file size in bytes... I tried various run times to get a better average... they all show that a dot is printed roughly every .0029 seconds.
How can this loop run in less than 3 ms per iteration when it should take 15 ms just to timeout?
(This could explain some funky timing issues with SERIN...)
Comments
bugg
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I think I know what I'm doing...
I tested this particular program for 10 seconds... the loop ran in about 8 ms despite a 15 ms timeout. (My math was a little off before... its still way fast--2x what it should be--but not as bad as I indicated earlier).
Dave