torrust-tracker-clock 3.0.0

A library to a clock for the torrust tracker.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::Duration;

use torrust_tracker_clock::clock::Time;

use crate::CurrentClock;

#[test]
fn it_should_use_stopped_time_for_testing() {
    assert_eq!(CurrentClock::dbg_clock_type(), "Stopped".to_owned());

    let time = CurrentClock::now();
    std::thread::sleep(Duration::from_millis(50));
    let time_2 = CurrentClock::now();

    assert_eq!(time, time_2);
}