mirror of
https://github.com/mikedilger/chorus.git
synced 2026-08-01 07:21:39 +00:00
Time::now()
This commit is contained in:
parent
4122014ff7
commit
6f2708c1a4
@ -21,4 +21,9 @@ impl Time {
|
||||
pub fn max() -> Time {
|
||||
Time(u64::MAX)
|
||||
}
|
||||
|
||||
pub fn now() -> Time {
|
||||
// Safety: unwrap() can only panic if the system time is before UNIX_EPOCH
|
||||
Time(std::time::UNIX_EPOCH.elapsed().unwrap().as_secs())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user