Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
criterion 0.5.1 - Docs.rs
[go: Go Back, main page]

criterion 0.5.1

Statistics-driven micro-benchmarking library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use rand::distributions::{Distribution, Standard};
use rand::prelude::*;
use rand::rngs::StdRng;

pub fn vec<T>(size: usize, start: usize) -> Option<Vec<T>>
where
    Standard: Distribution<T>,
{
    if size > start + 2 {
        let mut rng = StdRng::from_entropy();

        Some((0..size).map(|_| rng.gen()).collect())
    } else {
        None
    }
}