Files
Gaze/Gaze/Protocols/TimeProviding.swift
Michael Freno f8868c9253 pass 1
2026-01-27 14:12:24 -05:00

22 lines
452 B
Swift

//
// TimeProviding.swift
// Gaze
//
// Protocol for abstracting time sources to enable deterministic testing.
//
import Foundation
/// Protocol for providing current time, enabling deterministic tests.
protocol TimeProviding: Sendable {
/// Returns the current date/time
func now() -> Date
}
/// Default implementation that uses the system clock
struct SystemTimeProvider: TimeProviding {
func now() -> Date {
Date()
}
}