jitter

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package jitter provides a stochastic ticker that returns ticks at a random interval specified by a normal distribution with a mean periodicity and a standard deviation, sigma both of which are time.Durations.

This is a simplified version of https://github.com/lthibault/jitterbug.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ticker

type Ticker struct {
	C        <-chan time.Time
	Interval time.Duration
	Sigma    time.Duration
	// contains filtered or unexported fields
}

Ticker behaves like time.Ticker (listen on Ticker.C for timestamps).

func New

func New(interval, sigma time.Duration) (j *Ticker)

New returns a new stochastic timer with the specified interval and standard deviation.

func (*Ticker) Stop

func (j *Ticker) Stop()

Stop the Ticker.

Jump to

Keyboard shortcuts

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