📌  相关文章
📜  golang 以毫秒为单位的时间差 - Go 编程语言 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:00.507000             🧑  作者: Mango

代码示例1
package main
import (
        "log"
        "time"
)
func main() {
        start := time.Now().UnixNano() / int64(time.Millisecond)
        // do something
        time.Sleep(1 * time.Second)
        end := time.Now().UnixNano() / int64(time.Millisecond)
        diff := end - start
        log.Printf("Duration(ms): %d", diff)
}