Created
February 12, 2020 13:29
-
-
Save dtynn/3fef22df85c83bfb77a224b30f5d09f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{env, thread::sleep, time::Duration}; | |
fn main() { | |
let flag = env::args().nth(1).unwrap_or("".to_owned()); | |
match flag.as_str() { | |
"" => { | |
println!("using vec![vec![u32; 14]; 1<<30]"); | |
let _cache = vec![vec![0u32; 14]; 1 << 30]; | |
println!("hold 10s"); | |
sleep(Duration::from_secs(10)); | |
} | |
_ => { | |
println!("using vec![u32; 14<<30]"); | |
let mut cache = vec![0u32; 14 << 30]; | |
for i in 0..cache.len() { | |
cache[i] = i as u32; | |
} | |
println!("hold 10s"); | |
sleep(Duration::from_secs(10)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment