Skip to content

Conversation

@dobshn
Copy link

@dobshn dobshn commented Mar 22, 2025

Changes

  • Fixed duration calculation in reset() method.
  • Previously, Math.random() was multiplied by milliseconds + variance, which caused incorrect variance handling.
  • Now correctly uses variance * 2 to randomize duration between (milliseconds - variance) and (milliseconds + variance).

Why

  • Ensures the cooldown duration properly reflects the intended variance range.

Please let me know if any changes are needed.
Thank you! 😀

Corrected the random variance range to properly calculate duration between (milliseconds - variance) and (milliseconds + variance).
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.

1 participant