1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-26 13:48:49 +08:00
2013-10-25 15:41:02 -07:00

21 lines
235 B
Go

package gobot
import (
"time"
)
func Every(t time.Duration, f func()) {
go func(){
for{
time.Sleep(t)
f()
}
}()
}
func After(t time.Duration, f func()) {
go func(){
time.Sleep(t)
f()
}()
}