Skip to content
Kyuchumimo edited this page Oct 13, 2021 · 7 revisions

time

time -> ticks elapsed since game start

Returns

  • ticks : the number of milliseconds elapsed since the game was started

Description

This function returns the number of milliseconds elapsed since the game began execution. Useful for keeping track of time, animating items and triggering events.

Example

#####################################

# time demo

while True:
    cls()
    #Show rising time
    print('Seconds elapsed: {}'.format(time()/1000))  
 
    #Blink warning
    if(time()%500>250):
        print('Warning!',0,30)
 
    #After 2 seconds show this message
    if(time()>2000):
        print('Fugit inreparabile tempus',0,60)

#####################################

Clone this wiki locally