]> git.lizzy.rs Git - rust.git/blob - library/core/benches/lib.rs
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
[rust.git] / library / core / benches / lib.rs
1 // wasm32 does not support benches (no time).
2 #![cfg(not(target_arch = "wasm32"))]
3 #![feature(flt2dec)]
4 #![feature(int_log)]
5 #![feature(test)]
6 #![feature(trusted_random_access)]
7
8 extern crate test;
9
10 mod any;
11 mod ascii;
12 mod char;
13 mod fmt;
14 mod hash;
15 mod iter;
16 mod num;
17 mod ops;
18 mod pattern;
19 mod slice;
20 mod str;
21
22 /// Returns a `rand::Rng` seeded with a consistent seed.
23 ///
24 /// This is done to avoid introducing nondeterminism in benchmark results.
25 fn bench_rng() -> rand_xorshift::XorShiftRng {
26     const SEED: [u8; 16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
27     rand::SeedableRng::from_seed(SEED)
28 }