diff --git a/governor/Cargo.toml b/governor/Cargo.toml index e8c0253..a817180 100644 --- a/governor/Cargo.toml +++ b/governor/Cargo.toml @@ -53,6 +53,7 @@ futures-timer = { version = "3.0.3", optional = true } futures-util = { version = "0.3.31", optional = true, default-features = false, features = ["std", "sink"] } futures-sink = { version = "0.3.31", optional = true } rand = { version = "0.8.0", optional = true } +getrandom = { version = "0.2", features = ["js"] } dashmap = { version = "6.1.0", optional = true } quanta = { version = "0.12.0", optional = true } no-std-compat = { version = "0.4.1", features = [ "alloc" ] } @@ -60,3 +61,4 @@ cfg-if = "1.0" # To ensure we don't pull in vulnerable smallvec, see https://github.com/antifuchs/governor/issues/60 smallvec = "1.6.1" +web-time = "1.1.0" diff --git a/governor/src/clock/with_std.rs b/governor/src/clock/with_std.rs index c709604..878647f 100644 --- a/governor/src/clock/with_std.rs +++ b/governor/src/clock/with_std.rs @@ -4,7 +4,8 @@ use std::prelude::v1::*; use crate::nanos::Nanos; use std::ops::Add; -use std::time::{Duration, Instant, SystemTime}; +use std::time::{Duration, SystemTime}; +use web_time::Instant; /// The monotonic clock implemented by [`Instant`]. #[derive(Clone, Debug, Default)]