Skip to content

Fix throttled execution running too soon after an earlier trailing execution

Compare
Choose a tag to compare
@Aldaviva Aldaviva released this 11 Sep 09:36
· 30 commits to master since this release

If you have a function that is throttled to run at most once every 1 second with leading and trailing executions, and you invoke it twice at 0.0s, then it will execute once at 0.0s and once at 1.0s. However, a third invocation at 1.2s must not execute until 2.0s, since the duration between the second and third executions would otherwise be 0.2s, which is less than the minimum duration of 1.0s specified.