Skip to content

Instantly share code, notes, and snippets.

@ota42y
Created September 8, 2014 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ota42y/d8c0d2426bb5dc0cf9e9 to your computer and use it in GitHub Desktop.
Save ota42y/d8c0d2426bb5dc0cf9e9 to your computer and use it in GitHub Desktop.
github.com/robfig/cronの動作テスト
package main
import (
"fmt"
"github.com/robfig/cron"
"time"
)
func main() {
c := cron.New()
c.AddFunc("*/1 * * * * *", func() { fmt.Println("1 second!") })
c.AddFunc("0 */1 * * * *", func() { fmt.Println("1 minues!") })
c.Start()
for {
time.Sleep(10000000000000)
fmt.Println("sleep")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment