Skip to content

Commit

Permalink
Add note about impurity of SystemTime
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Oct 22, 2024
1 parent e59f2cf commit 452f8e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion boringtun/src/noise/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl TimeStamper {
/// Create a new TimeStamper
pub fn new(now: Instant) -> TimeStamper {
TimeStamper {
duration_at_start: SystemTime::now()
duration_at_start: SystemTime::now() // This is technically impure but it doesn't matter because the generated timestamps are only offset by this.
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap(),
instant_at_start: now,
Expand Down

0 comments on commit 452f8e8

Please sign in to comment.