? Using MICPOS for timing ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Migrating to a new website for SmileBASIC 4

Using MICPOS for timing

MICPOS updates twice as often (~2000x per second) as MILLISEC, so it can be used for more accurate timing. There aren't many situations where this is useful, and it's probably not a good idea to rely on this for anything important (apparently it doesn't even work on the Wii U). XON MIC MICSTART 3,0,0 'start timer: VAR FRAMESTART=MICPOS '... 'end timer: VAR TIME=MICPOS-FRAMESTART VAR SECONDS#=TIME/32728 MICPOS is updated after every statement, but always increases by 16, so the actual update rate is limited to sample rate/16, which is at most 32728/16 = 2039.25 times per second. It also can't record times longer than the size of the sample buffer, which is just over 4 seconds at a sample rate of 32728.
Author
12Me21
Updated
Rating
2 votes
Categories
Keywords
2 Comment(s) DFrost DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength hmmmmm.... DFrost DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength cool!!!