https://github.com/dutchcoders/gotimer
Timer library for go. Will call function after timeout.
https://github.com/dutchcoders/gotimer
Last synced: 9 months ago
JSON representation
Timer library for go. Will call function after timeout.
- Host: GitHub
- URL: https://github.com/dutchcoders/gotimer
- Owner: dutchcoders
- License: mit
- Created: 2015-01-12T21:46:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-12T21:59:10.000Z (over 11 years ago)
- Last Synced: 2024-12-27T09:12:23.683Z (over 1 year ago)
- Language: Go
- Size: 129 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gotimer
Timer library for go. Will call function after timeout.
### Example
```
package main
import (
"fmt"
"github.com/dutchcoders/gotimer"
"time"
)
func main() {
var i int = 0
go timer.Interval(func() error {
fmt.Printf("test %d\n", i)
i++
return nil
}, 1000*time.Millisecond)
time.Sleep(100000 * time.Millisecond)
}
```