Clarify timer precision in docs#2009
Closed
sapphonie wants to merge 1 commit intoalliedmodders:masterfrom
Closed
Conversation
peace-maker
requested changes
Jun 30, 2023
Member
peace-maker
left a comment
There was a problem hiding this comment.
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. |
Member
There was a problem hiding this comment.
"rounded up"? might as well be explicit when we add a note.
Contributor
Author
There was a problem hiding this comment.
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?
Member
|
It's driven by the framerate, so it's not super accurate or precise.On Jun 30, 2023 11:20 PM, sappho ***@***.***> wrote:
@sapphonie commented on this pull request.
In plugins/include/timers.inc:
*
* @param interval Interval from the current game time to execute the given function.
+ * Timer intervals are rounded to the nearest tenth of a second.
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?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Frenzoid
approved these changes
Jul 8, 2023
Contributor
Author
|
Closing in favor of #2014 , will reopen if that PR fails |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Common footgun, should be clarified