Crate time_source

Source
Expand description

Time source abstraction for obtaining the current time in milliseconds.

This module defines a TimeSource trait and two implementations:

§Example

use time_source::*;
let system_time = SystemTimeSource;
let now = system_time.get_current_time_millis();
println!("Current time: {now} ms since epoch");

Structs§

MockedTimeSource
A mock implementation of TimeSource for testing purposes.
SystemTimeSource
A system clock based time source

Traits§

TimeSource
A trait representing a source of time that can provide the current time in milliseconds.