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.

godotengine.org | Twitter

+1 vote

I've seen this Q&A:
https://godotengine.org/qa/12468/start-reset-game-get_unix_time-when-player-clicks-buttons

But I was wondering how to add deciseconds and centiseconds to the stopwatch (milliseconds would be nice but I could live with just 2 digits), the way that Q&A suggests, with the func _process(delta) I can only get track of the seconds elapsed.
And using the OS.get_unix_time() seems expensive and would not be able to pause the game (or at least I don't know how with that approach).

Why I would need to know the tenths of a second elapsed?

Well, I have this platformer game and I want to time players their way to the end of the level and then make a best times screen, so the more digits: less probability of them ending up with a very similar time and more precise representation of their performance.

in Engine by (12 points)
edited by

1 Answer

0 votes

Sounds like OS.getticksmsec ( ) would work

by (1,003 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.