1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-24 13:48:49 +08:00
hybridgroup.gobot/examples/every_done.go
Thomas Kohler 865e724af0
Build(v2): revert move to v2 subfolder (#932)
* revert move to v2 subfolder
* fix CI and adjust CHANGELOG
2023-05-29 19:23:28 +02:00

33 lines
415 B
Go

//go:build example
// +build example
//
// Do not build by default.
package main
import (
"fmt"
"time"
"gobot.io/x/gobot/v2"
)
func main() {
robot := gobot.NewRobot(
"hello",
func() {
done := gobot.Every(750*time.Millisecond, func() {
fmt.Println("Greetings human")
})
gobot.After(5*time.Second, func() {
done.Stop()
fmt.Println("We're done here")
})
},
)
robot.Start()
}