time.Now().Sub(t)
instead of time.Since(t)
SCC-S101274}
75
76func timer(t0 time.Time) time.Duration {
77 dur := time.Now().Sub(t0)78 return dur
79}
80
The time.Since(t)
helper has the same effect as using time.Now().Sub(t)
.
time.Since(t)
returns the time elapsed since t
. It is shorthand for
time.Now().Sub(t)
.
time.Now().Sub(x)
time.Since(x)