Skip to content
planer28 edited this page Jul 15, 2018 · 11 revisions

time

time -> milliseconds elapsed from game start

Output:

  • ticks : return the numbers 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 the time, animate items and rise 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
Clone this wiki locally