Debounce and caching

This commit is contained in:
HugeFrog24
2026-09-09 18:18:18 +02:00
parent 82fff17e66
commit ffb3a31db8
46 changed files with 8764 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
package main
import "time"
type Clock interface {
Now() time.Time
}
type RealClock struct{}
func (RealClock) Now() time.Time {
return time.Now()
}
type MockClock struct {
currentTime time.Time
}
func (mc *MockClock) Now() time.Time {
return mc.currentTime
}
func (mc *MockClock) Advance(d time.Duration) {
mc.currentTime = mc.currentTime.Add(d)
}