randextensions

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Jitter

func Jitter(r *rand.Rand, t time.Duration, jitter float64) time.Duration

Jitter returns the provided duration, scaled by a jitter factor. jitter must be between 0 and 1. After jitter is applied the result will be in the range: [(1-jitter)t, (1+jitter)t], UNLESS (1+jitter)t is larger than MaxInt64, in which case the range will be [(1-jitter)t, math.MaxInt64]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL