"Gocron"의 두 판 사이의 차이

(새 문서: ==개요== ;gocron <syntaxhighlight lang='go' run> package main import ( "fmt" "time" "github.com/go-co-op/gocron" ) func main() { s := gocron.NewScheduler(time.UTC) s.Every(...)
 
1번째 줄: 1번째 줄:
==개요==
==개요==
;gocron
;gocron
* Go언어 작업 스케줄링 패키지


<syntaxhighlight lang='go' run>
<syntaxhighlight lang='go' run>

2022년 5월 18일 (수) 03:04 판

1 개요

gocron
  • Go언어 작업 스케줄링 패키지
package main

import (
	"fmt"
	"time"

	"github.com/go-co-op/gocron"
)

func main() {
	s := gocron.NewScheduler(time.UTC)
	s.Every(1).Seconds().Do(func() { fmt.Println(time.Now()) })
	s.StartAsync()
	time.Sleep(5 * time.Second)
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}