How can I check how many seconds have passed since the start of the script execution?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ZeralldGames

ENG:
How can I check how many seconds have passed since the start of the script execution?
I need to make it so that I can check exactly how many seconds have passed since the function was executed. In my case, it is 2 seconds.
RUS:
Как я могу проверить, сколько секунд прошло с начала выполнения скрипта?
Мне нужно сделать так, чтобы я мог точно проверить, сколько секунд прошло с момента выполнения функции. В моем случае это 2 секунды

Thanks very much!

:bust_in_silhouette: Reply From: klaas

Hi,
do you mean:

int get_ticks_msec ( ) const 

Returns the amount of time passed in milliseconds since the engine started.

or you just save this value and compare it to “now”

var start = OS.get_ticks_msec()
#then later
print( str(OS.get_ticks_msec()-start)+" have past since start" )