1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-28 16:10:05 +08:00

chore: uses

This commit is contained in:
2021-01-03 13:12:55 +08:00
parent aa8b4ed447
commit 50159a0ca8
9 changed files with 23 additions and 27 deletions

View File

@@ -1,5 +1,4 @@
use std::time::SystemTime;
use std::time::Duration;
use std::time::{SystemTime, Duration};
pub fn get_current_secs() -> u64 {
SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0 /* SHOULD NOT HAPPEN */ )