Skip to content

Commit a2c35ea

Browse files
committed
[bugfix] Calculate time provider time correctly
1 parent ea04a8c commit a2c35ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/timer/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var SysSleepConsumer = func(d time.Duration) { time.Sleep(d) }
1818

1919
// NewFixedTimeProviderFromNanoSeconds creates a time provider from long nano seconds that always returns a fixed time
2020
func NewFixedTimeProviderFromNanoSeconds(timestamp int64) TimeProvider {
21-
sec := timestamp / 1e9
22-
nSec := (timestamp - sec) * 1e9
21+
sec := int64(timestamp / 1e9)
22+
nSec := timestamp - sec*1e9
2323
return func() time.Time {
2424
return time.Unix(sec, nSec)
2525
}

0 commit comments

Comments
 (0)