Function faketime::unix_time_as_millis
source · pub fn unix_time_as_millis() -> u64
Expand description
Gets elapsed time in milliseconds since UNIX EPOCH.
let now = faketime::unix_time();
let millis = faketime::unix_time_as_millis();
assert!(millis / 1000 - now.as_secs() < 60);
This function depends on the return result from unix_time
. If unix_time
is faked, this
function is also faked.
Panics
Panics if the time is before UNIX EPOCH, or u64
is not enough to store the number of
milliseconds.