Skip to content

Commit

Permalink
Use web_time for SystemTime::now to support WASM runtimes (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Dotan Simha <[email protected]>
  • Loading branch information
dotansimha authored Jan 24, 2024
1 parent 049a30f commit b77884c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
ctor = "0.1.20"
coarsetime = "0.1"
web-time = "1.0"

[features]
atomic = []
Expand Down
3 changes: 2 additions & 1 deletion src/instant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use std::{
ops::{Add, AddAssign, Sub, SubAssign},
time::{Duration, SystemTime, UNIX_EPOCH},
time::Duration,
};
use web_time::{SystemTime, UNIX_EPOCH};

/// A measurement of a monotonically nondecreasing clock. Similar to
/// [`std::time::Instant`](std::time::Instant) but is faster and more
Expand Down

0 comments on commit b77884c

Please sign in to comment.