Implement challenge 24 and finish set 3.

This commit is contained in:
2022-08-12 12:28:19 -04:00
parent 98ad4c7712
commit fbf26efa44
6 changed files with 145 additions and 19 deletions

9
src/utils.rs Normal file
View 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
}