Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify timer precision in docs #2009

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/include/timers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ typeset Timer
};

/**
* Creates a basic timer. Calling CloseHandle() on a timer will end the timer.
* 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?

* @param func Function to execute once the given interval has elapsed.
* @param data Handle or value to pass through to the timer callback function.
* @param flags Flags to set (such as repeatability or auto-Handle closing).
Expand Down