summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/examples/time.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/examples/time.rs')
-rw-r--r--vendor/rustix/examples/time.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/rustix/examples/time.rs b/vendor/rustix/examples/time.rs
new file mode 100644
index 000000000..3648336a7
--- /dev/null
+++ b/vendor/rustix/examples/time.rs
@@ -0,0 +1,20 @@
+//! A command which prints the current values of the realtime and monotonic
+//! clocks it's given.
+
+#[cfg(not(windows))]
+#[cfg(feature = "time")]
+fn main() {
+ println!(
+ "Real time: {:?}",
+ rustix::time::clock_gettime(rustix::time::ClockId::Realtime)
+ );
+ println!(
+ "Monotonic time: {:?}",
+ rustix::time::clock_gettime(rustix::time::ClockId::Monotonic)
+ );
+}
+
+#[cfg(any(windows, not(feature = "time")))]
+fn main() {
+ unimplemented!()
+}