+2 votes

So, sometimes when i use debug in godot i noticed that when the current function body ends without return or pass debugger in rare occasions continues to work on next empty rows after current function body. Debugger continues to do it until it finds new function body, after which it returns to whatever it was doing.
Of course, it doesnt wreck program logic or generate error but i was wondering if these extra debugger steps somehow add extra unnessary steps to program execution, so my question is: if i will add return statement at the end of the functions will it optimize the program?

in Engine by (16 points)

You could try running diagnostics yourself to check this by comparing elapsed time values on similar functions. OS.get_time() is available everywhere.

For accurate microbenchmarking, you'll want to use OS.get_ticks_usec() which returns a value in microseconds instead of OS.get_time().

Please log in or register to answer this question.

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.