2022-12-09 03:08:04 +00:00
|
|
|
package timesource
|
|
|
|
|
2022-12-10 15:38:18 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
)
|
2022-12-09 03:08:04 +00:00
|
|
|
|
|
|
|
type WallClockTimeSource struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultClock() *WallClockTimeSource {
|
|
|
|
return &WallClockTimeSource{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *WallClockTimeSource) Now() time.Time {
|
|
|
|
return time.Now()
|
|
|
|
}
|
|
|
|
|
2022-12-10 15:38:18 +00:00
|
|
|
func (t *WallClockTimeSource) Start(ctx context.Context) error {
|
2022-12-09 03:08:04 +00:00
|
|
|
// Do nothing
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *WallClockTimeSource) Stop() error {
|
|
|
|
// Do nothing
|
|
|
|
return nil
|
|
|
|
}
|