Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveNextTimePoint ¶
ResolveNextTimePoint returns the next time point.
Types ¶
type TimeSourceFunc ¶
type TimeSourceFunc func() int64
TimeSourceFunc is a function which gets an understanding of time in seconds resolution back.
type UnixTimestampPrng ¶
type UnixTimestampPrng struct {
// contains filtered or unexported fields
}
UnixTimestampPrng is a pseudo random number generator using the Unix time in seconds to derive a random number from.
func NewUnixTimestampPRNG ¶
func NewUnixTimestampPRNG(resolution int64, timeSourceFunc ...TimeSourceFunc) *UnixTimestampPrng
NewUnixTimestampPRNG creates a new Unix timestamp based pseudo random number generator using the given resolution. The resolution defines at which second interval numbers are generated.
func (*UnixTimestampPrng) C ¶
func (utrng *UnixTimestampPrng) C() <-chan float64
C returns the channel from which random generated numbers can be consumed from.
func (*UnixTimestampPrng) Start ¶
func (utrng *UnixTimestampPrng) Start()
Start starts the Unix timestamp pseudo random number generator by examining the interval and then starting production of numbers after at least interval seconds plus delta of the next resolution time have elapsed.
func (*UnixTimestampPrng) Stop ¶
func (utrng *UnixTimestampPrng) Stop()
Stop stops the Unix timestamp pseudo random number generator.