This is a piece of code by Pritchard that should illustrate time-based movement.
#include "fbgfx.bi"
screenres 640, 480, 16
'' initialize variables - UDTs are better but this is shorter
dim as integer x, y
dim as double timerDif, timerCur = timer, timerLast = timer
dim as double box_size, StartTime, EndTime, ResultTime
box_size = 9
StartTime = - 2
x = 50
y = 200
screenlock
do
'' IO here
if multikey(FB.SC_LEFT) then x -= 200 * timerDif
if multikey(FB.SC_RIGHT) then x += 200 * timerDif
if multikey(FB.SC_UP) then y -= 200 * timerDif
if multikey(FB.SC_DOWN) then y += 200 * timerDif
'' simple animation connected with the timerDif
box_size += 20 * timerDif
IF box_size > 20 THEN box_size = 9
'' graphics rendering here
line (x, y) - step (box_size, box_size), rgb(255, 255, 255), bf
'' time to pass the screen calculation related
'' variables.
'' If you pass the left edge of the screen reset
'' StartTime to -1.
IF x <= 0 AND StartTime = - 2 THEN StartTime = -1
'' If you get back on the screen from the left
'' side record the StartTime.
IF x >= 0 AND StartTime = -1 THEN StartTime = timer
' If you pass the right edge of the screen
' record EndTime and the ResultTime. Lock the
' timer until the user passes the left edge
' of the screen again.
IF x >= 640 AND StartTime > 0 THEN
EndTime = timer
ResultTime = EndTime - StartTime
EndTime = 0
StartTime = -2
END IF
Locate 1, 1
Print "Time to pass the screen (left to right): "; ResultTime
'' equivalent to a page flip
screenunlock
sleep 1, 1
screenlock
cls
'' frame update here
timerLast = timerCur
timerCur = timer
timerDif = (timerCur - timerLast)
loop until multikey(FB.SC_ESCAPE)
screenunlock
I implemented a test in it where the program records the time it took you to pass the screen from left to right. To test it, pass the left edge of the screen and then travel right until you pass the right edge.
I get times around 3.13 with different SLEEP amounts. You?