diff options
Diffstat (limited to 'tests/util.rs')
-rw-r--r-- | tests/util.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/util.rs b/tests/util.rs index bb41fb6..46ca46c 100644 --- a/tests/util.rs +++ b/tests/util.rs @@ -2,6 +2,7 @@ extern crate rand; extern crate rustc_serialize as serialize; +extern crate time; use std::io::prelude::*; use std::fs::File; @@ -57,3 +58,7 @@ pub fn random_aes_128_key () -> [u8; 16] { pub fn coinflip () -> bool { self::rand::thread_rng().gen() } + +pub fn now () -> u32 { + return self::time::now().to_timespec().sec as u32; +} |