16 lines
296 B
Rust
16 lines
296 B
Rust
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||
|
|
||
|
/// Get the current time since epoch
|
||
|
///
|
||
|
/// ```
|
||
|
/// use virtweb_backend::utils::time_utils::time;
|
||
|
///
|
||
|
/// let time = time();
|
||
|
/// ```
|
||
|
pub fn time() -> u64 {
|
||
|
SystemTime::now()
|
||
|
.duration_since(UNIX_EPOCH)
|
||
|
.unwrap()
|
||
|
.as_secs()
|
||
|
}
|