cooldown

package
v0.0.0-...-9648343 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CD

type CD struct {
	MSec int
	// contains filtered or unexported fields
}

CD is a cooldown with a fixed interval.

func (*CD) Cooldown

func (c *CD) Cooldown() bool

Cooldown checks if we're cooled down and if so unreadies.

func (*CD) Ready

func (c *CD) Ready(now time.Time) bool

Ready checks if the we're cooled down at the given time.

func (*CD) Set

func (c *CD) Set(now time.Time)

Set time to cooldown to the timestamp plus the cooldown time.

Jump to

Keyboard shortcuts

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