Skip to content

Commit

Permalink
Use web_time crate instead of std::time
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekvpandya committed Jan 22, 2024
1 parent b8a16b3 commit ec262b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion plonky2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ default = ["gate_testing", "parallel", "rand_chacha", "std", "timing"]
gate_testing = []
parallel = ["hashbrown/rayon", "plonky2_maybe_rayon/parallel"]
std = ["anyhow/std", "rand/std", "itertools/use_std"]
timing = ["std"]
timing = ["std", "dep:web-time"]

[dependencies]
ahash = { version = "0.8.3", default-features = false, features = ["compile-time-rng"] } # NOTE: Be sure to keep this version the same as the dependency in `hashbrown`.
Expand All @@ -34,6 +34,7 @@ serde = { version = "1.0", default-features = false, features = ["derive", "rc"]
serde_json = "1.0"
static_assertions = { version = "1.1.0", default-features = false }
unroll = { version = "0.1.5", default-features = false }
web-time = { version = "1.0.0", optional = true }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.2", default-features = false, features = ["js"] }
Expand Down
4 changes: 2 additions & 2 deletions plonky2/src/fri/reduction_strategies.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use alloc::vec;
use alloc::vec::Vec;
#[cfg(feature = "timing")]
use std::time::Instant;

#[cfg(feature = "timing")]
use web_time::Instant;
use log::debug;
use serde::Serialize;

Expand Down
3 changes: 1 addition & 2 deletions plonky2/src/util/timing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#[cfg(feature = "timing")]
use std::time::{Duration, Instant};

use web_time::{Duration, Instant};
use log::{log, Level};

/// The hierarchy of scopes, and the time consumed by each one. Useful for profiling.
Expand Down

0 comments on commit ec262b1

Please sign in to comment.