Skip to content

span42/go-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-timer

A very simple and easy-to-use timer

Details

Usage

package main

import (
	"fmt"
	"time"

	timer "github.com/span42/go-timer"
)

func main() {
	lpTimer1 := timer.NewTimer(lpFunc, "lpTimer1")
	defer lpTimer1.Destory()
	lpTimer1.Start(2000) //msec
	select {}
}

//timeout callback
func lpFunc(t *timer.Timer, lpArg ...interface{}) {
	t.Start(3000)
	fmt.Println(lpArg)
}

Possible Future Work

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages