Guest User

Untitled

a guest
Dec 18th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. use rand::{Rng, SeedableRng, rngs::StdRng};
  2. use std::time::SystemTime;
  3.  
  4. fn main() {
  5. let d = SystemTime::now()
  6. .duration_since(SystemTime::UNIX_EPOCH)
  7. .expect("Duration since UNIX_EPOCH failed");
  8. let mut rng = StdRng::seed_from_u64(d.as_secs());
  9.  
  10. println!("{:?}", rng.gen::<f32>());
  11. }
Add Comment
Please, Sign In to add comment