Skip to content

Commit

Permalink
fixup! Add WithDeadlineTimer interface to clock
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Jun 20, 2024
1 parent c981c5a commit 5064795
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clock/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ func (RealClock) NewTimer(d time.Duration) Timer {
}
}

// NewDeadlineTimer is the same as time.NewTimer(ts.Sub(time.Now()))
// NewDeadlineTimer is the same as time.NewTimer(time.Until(ts))
func (RealClock) NewDeadlineTimer(ts time.Time) Timer {
return &realTimer{
timer: time.NewTimer(ts.Sub(time.Now())),
timer: time.NewTimer(time.Until(ts)),
}
}

Expand Down

0 comments on commit 5064795

Please sign in to comment.