timeutil

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

type Timer struct {
	Counter  int  // 已执行次数
	Canceled bool // 是否已取消
	Ended    bool // 是否已结束
}

func SetInterval

func SetInterval(h func(), d time.Duration) *Timer

SetInterval 循环某个周期执行任务

func SetTimeout

func SetTimeout(h func(), d time.Duration) *Timer

SetTimeout 延时执行任务

func (*Timer) Cancel

func (t *Timer) Cancel() *Timer

Cancel 取消任务

Jump to

Keyboard shortcuts

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