Skip to content
borb edited this page Dec 31, 2024 · 12 revisions

time() -> time elapsed since game start

Returns

  • time : time elapsed since the game was started in milliseconds

Description

This function returns the milliseconds elapsed since the cartridge began execution. Useful for keeping track of time, animating items and triggering 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