utils

package
v0.0.0-...-a38fd9e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task = func()

Task is a job.

type Tasks

type Tasks = []func()

Tasks is a job group.

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

Timer is a Implement of Timer

func NewTimer

func NewTimer() *Timer

NewTimer is return a Timer Instance.

func (*Timer) AddJob

func (t *Timer) AddJob(seconds time.Duration, job Task)

AddJob is Add a Job to Jobs.

func (*Timer) AddJobs

func (t *Timer) AddJobs(seconds time.Duration, jobs ...Task)

AddJobs is Add a lot of jobs to Jobs.

func (*Timer) Run

func (t *Timer) Run()

Run All Jobs.

func (*Timer) Start

func (t *Timer) Start()

Start is Run All Jobs in goroutine.

func (*Timer) Stop

func (t *Timer) Stop()

Stop All Job in Timer

Jump to

Keyboard shortcuts

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