1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-26 13:48:49 +08:00
2013-10-23 22:00:03 -07:00

29 lines
353 B
Go

package gobot
import (
"time"
)
//type Gobot struct{
// Robot
// Connections []Connection
// Devices []Device
// Name string
// Work func()
//}
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()
}()
}