Atlas › Test

TestNewRealClock_Since

Exact test identity: go.temporal.io/server/common/clock/TestNewRealClock_Since

Package
go.temporal.io/server/common/clock
Suite / test hierarchy
TestNewRealClock_Since
Test
TestNewRealClock_Since
Introduced at
time_source.go ×1 Frontier kind: Joint frontier
Covered ranges
3
Covered lines
9
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/clock/time_source.go 9 covered LOC · 3 ranges

Open complete file

31
32 // NewRealTimeSource returns a timeSource that uses the real wall timeSource time.
33 > func NewRealTimeSource() RealTimeSource { time_source.go
34 > return RealTimeSource{}
35 > }
36
37 // Now returns the current time, with the location set to UTC.
38 > func (ts RealTimeSource) Now() time.Time { time_source.go
39 > return time.Now().UTC()
40 > }
41
42 // Since returns the time elapsed since t
43 > func (ts RealTimeSource) Since(t time.Time) time.Duration { time_source.go
44 > return time.Since(t)
45 > }
46
47 // AfterFunc is a pass-through to time.AfterFunc.