Expand description
Time source abstraction for obtaining the current time in milliseconds.
This module defines a TimeSource trait and two implementations:
SystemTimeSource: system-clock based implementationMockedTimeSource: mock implementation for testing purposes
§Example
use time_source::*;
let system_time = SystemTimeSource;
let now = system_time.get_current_time_millis();
println!("Current time: {now} ms since epoch");Structs§
- Mocked
Time Source - A mock implementation of
TimeSourcefor testing purposes. - System
Time Source - A system clock based time source
Traits§
- Time
Source - A trait representing a source of time that can provide the current time in milliseconds.