GO语言定时任务延时执行

代码:

package main

import "fmt"

func main() {
    timer := time.NewTicker(2 * time.Second)
    for {
        select {
        case <-timer.C:
            go func() {
                log.Println(time.Now())
            }()
        }
    }
}
2014-07-22 14:38