TICKS

n = TICKS

Returns the number of milliseconds that have elapsed since start of the operating system.

Example 1:

t = ticks()
print t

Example 2: Game with constant frame rate

' ticks() can be used to let your game
' run with a constant frame rate

FramesPerSecond = 20

for xx = 1 to 200

  StartTime = ticks()
  
  'Put your heavy computions here
  cls
  rect 10 + xx, 10, 50+xx, 50
  showpage

  'Delay the execution of the for-loop  
  StopTime = ticks()

  ElapsedTime = StopTime - StartTime

  if(ElapsedTime < 1000 / FramesPerSecond)
    delay(1000 / FramesPerSecond - ElapsedTime)
  endif

next
Date
If there is insufficient information on this page and you wish learn more about TICKS, please send an email to smallbasic@gmail.com. You can help to improve information about TICKS by submitting a pull request, click View Source for details. Note, an offline language reference text file is also available - see the Download section.