The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

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.
Как я могу проверить, сколько секунд прошло с начала выполнения скрипта?
Мне нужно сделать так, чтобы я мог точно проверить, сколько секунд прошло с момента выполнения функции. В моем случае это 2 секунды

Thanks very much!

Godot version 3.3.1
in Engine by (49 points)

1 Answer

0 votes

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" )
by (4,088 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.