Rollup merge of #136949 - ehuss:wasm-bench-time, r=jhpratt

Fix import in bench for wasm

This import was causing annoying unused import errors when checking the standard library for some wasm targets. The problem is that everything here is disabled if it is wasm32, but this import wasn't cfg'd.
This commit is contained in:
Jacob Pratt 2025-02-13 03:53:33 -05:00 committed by GitHub
commit f9142b0785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,3 @@
use std::time::Instant;
#[cfg(not(target_arch = "wasm32"))]
use test::{Bencher, black_box};
@ -10,6 +8,7 @@ macro_rules! bench_instant_threaded {
fn $bench_name(b: &mut Bencher) -> std::thread::Result<()> {
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Instant;
let running = Arc::new(AtomicBool::new(true));