Skip to content

Conversation

sapphonie
Copy link
Contributor

Common footgun, should be clarified

@sapphonie sapphonie changed the title Clarify timer precision Clarify timer precision in docs Jun 29, 2023
Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this is an implementation detail, it's a common source of confusion, so worth adding a note. Thank you!

* Creates a basic timer with 0.1 second accuracy. Calling CloseHandle() on a timer will end the timer.
*
* @param interval Interval from the current game time to execute the given function.
* Timer intervals are rounded to the nearest tenth of a second.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"rounded up"? might as well be explicit when we add a note.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, after talking about it in the SM discord, I still don't quite understand what is going on with timer precision - as far as I know, it just executes on a think every 100ms, but a global think and not a per timer think?

@dvander
Copy link
Member

dvander commented Jul 1, 2023 via email

@sapphonie
Copy link
Contributor Author

Closing in favor of #2014 , will reopen if that PR fails

@sapphonie sapphonie closed this Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants