time.Now().Sub(t)
instead of time.Since(t)
SCC-S1012475 By("waiting for connections to be idle before exiting")
476 before := time.Now()
477 Expect(<-registerErr).To(Equal(tsa.ErrConnectionDrainTimeout))
478 Expect(time.Now().Sub(before)).To(BeNumerically("~", opts.ConnectionDrainTimeout, time.Second))479 })
480 })
481 })
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)