To all,
If you are using the
SYNC and
SYNC RATE commands, you can have complete control over the accuracy of counting up seconds. First,
SYNC is what will refresh the screen, whensoever it is placed in your code. Second,
SYNC RATE is the amount of times the screen will be refreshed per second.
So, using this information, you should now see a way to accurately count seconds. Try this
set display mode 800,600,32
sync on
sync rate 40
do
count = count + 1
if count = 40
seconds = seconds + 1
count = 0
endif
print seconds
sync
cls
loop
. When a
SYNC RATE is set, your computer,
to it's fullest ability, will refresh the screen that amount of times
per second. For example, if
SYNC RATE is set to
40, your computer will pass through your code 40 times a second. As in the code snippet above, I have created a variable(count), which is incremented by 1 each loop. Once it reaches 40, it increments the variable(seconds) by 1. If you run this code above, you will see that it will accurately print a countup of seconds onto the screen.
+NanoBrain+