blob: 8eba50cdb2ce5133f29f26824408a38c5f6d83c0 (
plain)
1
2
3
4
5
6
7
8
|
use std::time;
pub fn initialize_rng_from_time() {
let r = random::default();
let now = time::SystemTime::now();
let nano_secs = now.duration_since(time::SystemTime::UNIX_EPOCH).unwrap().as_nanos();
r.seed([(nano_secs >> 64) as u64, nano_secs as u64]);
}
|