From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- third_party/rust/instant/src/native.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 third_party/rust/instant/src/native.rs (limited to 'third_party/rust/instant/src/native.rs') diff --git a/third_party/rust/instant/src/native.rs b/third_party/rust/instant/src/native.rs new file mode 100644 index 0000000000..37b34f3e8b --- /dev/null +++ b/third_party/rust/instant/src/native.rs @@ -0,0 +1,9 @@ +pub type Instant = std::time::Instant; +pub type SystemTime = std::time::SystemTime; + +/// The current time, expressed in milliseconds since the Unix Epoch. +pub fn now() -> f64 { + std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH) + .expect("System clock was before 1970.") + .as_secs_f64() * 1000.0 +} -- cgit v1.2.3