1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 11:10:40 +00:00

Revert "should use time.Since instead of time.Now().Sub"

This commit is contained in:
astaxie
2017-09-09 06:29:38 +08:00
committed by GitHub
parent 07a9a2d0f3
commit a7354d2d08
6 changed files with 7 additions and 7 deletions

View File

@ -106,7 +106,7 @@ func printGC(memStats *runtime.MemStats, gcstats *debug.GCStats, w io.Writer) {
if gcstats.NumGC > 0 {
lastPause := gcstats.Pause[0]
elapsed := time.Since(startTime)
elapsed := time.Now().Sub(startTime)
overhead := float64(gcstats.PauseTotal) / float64(elapsed) * 100
allocatedRate := float64(memStats.TotalAlloc) / elapsed.Seconds()
@ -123,7 +123,7 @@ func printGC(memStats *runtime.MemStats, gcstats *debug.GCStats, w io.Writer) {
toS(gcstats.PauseQuantiles[99]))
} else {
// while GC has disabled
elapsed := time.Since(startTime)
elapsed := time.Now().Sub(startTime)
allocatedRate := float64(memStats.TotalAlloc) / elapsed.Seconds()
fmt.Fprintf(w, "Alloc:%s Sys:%s Alloc(Rate):%s/s\n",