random

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dur

func Dur(max time.Duration) time.Duration

Dur returns a pseudo-random Duration in [0, max)

func Jitter

func Jitter(period time.Duration) time.Duration

Uniformly jitters the provided duration by +/- 10%.

func JitterFraction

func JitterFraction(period time.Duration, fraction float64) time.Duration

Uniformly jitters the provided duration by +/- the given fraction. NOTE: fraction must be in (0, 1].

Types

This section is empty.

Jump to

Keyboard shortcuts

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