https://github.com/x-mod/heaptimer
https://github.com/x-mod/heaptimer
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/x-mod/heaptimer
- Owner: x-mod
- Created: 2020-08-11T02:01:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-27T18:03:44.000Z (about 4 years ago)
- Last Synced: 2024-06-20T06:30:30.497Z (almost 2 years ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
heaptimer
===
## Quick Start
````go
import "github.com/x-mod/heaptimer"
timer := heaptimer.New(time.Microsecond * 100)
go timer.Serve(context.TODO())
defer timer.Close()
timer.Push(v1, time.Now())
timer.Push(v2, time.Now().Add(time.Second * 2))
timer.PushWithDuration(v3, time.Second * 3)
v, ok := timer.Pop()
//OR
v, ok := <-timer.V
````