Skip to content

Commit 48d26cc

Browse files
committed
a
1 parent 314af18 commit 48d26cc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ mod test_db {
7272
status: hyper::StatusCode::OK,
7373
len_bytes: 100,
7474
start_latency_correction: None,
75-
start: crate::small_instant::SmallInstant::now(),
75+
start: start + std::time::Duration::from_millis(50),
7676
connection_time: None,
7777
first_byte: None,
78-
end: crate::small_instant::SmallInstant::now(),
78+
end: start + std::time::Duration::from_millis(150),
7979
};
8080
let test_vec = vec![test_val.clone(), test_val.clone()];
8181
let client = Client::default();

src/small_instant.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ pub struct SmallInstant {
1414

1515
impl SmallInstant {
1616
pub fn now() -> Self {
17+
let start = *START_INSTANT;
1718
let now = std::time::Instant::now();
18-
let nanos = now.duration_since(*START_INSTANT).as_nanos() as u64;
19+
let nanos = now.duration_since(start).as_nanos() as u64;
1920

2021
SmallInstant {
2122
nanos: NonZeroU64::new(nanos).unwrap(),

0 commit comments

Comments
 (0)