Skip to content
Nalquas edited this page Nov 17, 2018 · 7 revisions

time

time -> milliseconds elapsed since game start

Output:

  • ticks : returns the number of milliseconds elapsed from the beginning of the application.

Description:

The function returns the elapsed time from the start of the cartridge expressed in milliseconds. Useful to keep track of time, animate items and trigger events.

Example

Example

-- time demo

function TIC()
 cls()
 --Show rising time
 print('Seconds elapsed: '..time()/1000)  
 
 --Blink warning
 if(time()%500>250) then
  print('Warning!',0,30)
 end
 
 --After 2 seconds show this message
 if(time()>2000)then
  print('Fugit inreparabile tempus',0,60)
 end 
end
You can’t perform that action at this time.