mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-01 13:48:57 +08:00
22 lines
266 B
Go
22 lines
266 B
Go
![]() |
package gobot
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
//type Gobot struct{
|
||
|
// Robot
|
||
|
// Connections []Connection
|
||
|
// Devices []Device
|
||
|
// Name string
|
||
|
// Work func()
|
||
|
//}
|
||
|
|
||
|
func Every(t time.Duration, ret func()) {
|
||
|
go func(){
|
||
|
for{
|
||
|
ret()
|
||
|
time.Sleep(t)
|
||
|
}
|
||
|
}()
|
||
|
}
|