https://github.com/eighty4/ebauche
https://github.com/eighty4/ebauche
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eighty4/ebauche
- Owner: eighty4
- License: bsd-2-clause
- Created: 2021-11-03T14:10:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-05T00:05:40.000Z (over 4 years ago)
- Last Synced: 2024-06-20T10:13:16.432Z (about 2 years ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/eighty4/ebauche)
# Èbauche
```
\ āˈbōsh \
plural -s
: an incomplete watch movement consisting of plates,
bridges, wheels, and barrels to be finished and fitted
with jewels, escapement, mainspring, hands, and dial
```
Time-related fn utils
```
go get github.com/eighty4/ebauche
```
## IntervalIndefinitely
Executes fn indefinitely on interval
```go
ebauche.IntervalIndefinitely(time.Second * 1, func() {
fmt.Println("i print every second")
})
```
## Interval
Executes predicate indefinitely on interval until it returns false
```go
limit := 84
count := 0
fmt.Println("i will print", limit, "times")
ebauche.Interval(time.Millisecond * 1, func() bool {
fmt.Println("print", count)
count++
return count < limit
})
```