Implement challenge 24 and finish set 3.
This commit is contained in:
9
src/utils.rs
Normal file
9
src/utils.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
pub fn unix_timestamp() -> u32 {
|
||||
let start = SystemTime::now();
|
||||
let since_the_epoch = start
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.expect("Time went backwards");
|
||||
since_the_epoch.as_secs() as u32
|
||||
}
|
||||
Reference in New Issue
Block a user