Posted on 2013-12-19 16:15
oathleo 閱讀(5368)
評論(0) 編輯 收藏 所屬分類:
Golang
package main
import (
"fmt"
"mag/common"
"time"
)
func main() {
c := make(chan bool, 10)
tt := common.GetTodayGivenTime("161300")
dd := common.SinceNow(tt)
time.AfterFunc(dd, func() { //非阻塞
//后續每24小時建立目錄
ticker24h := time.NewTicker(5 * time.Second)
for {
select {
case <-ticker24h.C:
fmt.Println("print")
}
}
})
<-c
}