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:

  • SystemTimeSource: system-clock based implementation
  • [MockedTimeSource]: 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§

SystemTimeSource
A system clock based time source

Traits§

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