Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use rand::{Rng, SeedableRng, rngs::StdRng};
- use std::time::SystemTime;
- fn main() {
- let d = SystemTime::now()
- .duration_since(SystemTime::UNIX_EPOCH)
- .expect("Duration since UNIX_EPOCH failed");
- let mut rng = StdRng::seed_from_u64(d.as_secs());
- println!("{:?}", rng.gen::<f32>());
- }
Add Comment
Please, Sign In to add comment