aboutsummaryrefslogtreecommitdiff
path: root/vendor/instant/src/native.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/instant/src/native.rs')
-rw-r--r--vendor/instant/src/native.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/instant/src/native.rs b/vendor/instant/src/native.rs
new file mode 100644
index 0000000..a1412aa
--- /dev/null
+++ b/vendor/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
+}