From 5d3e5531412952c556fabb541536bcae34b0ce09 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 29 Apr 2011 11:54:06 -0700 Subject: stdlib: Add a Time module to the standard library --- src/lib/Time.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/lib/Time.rs (limited to 'src/lib/Time.rs') diff --git a/src/lib/Time.rs b/src/lib/Time.rs new file mode 100644 index 00000000..70a12a6f --- /dev/null +++ b/src/lib/Time.rs @@ -0,0 +1,12 @@ +native "rust" mod rustrt { + fn get_time(&mutable u32 sec, &mutable u32 usec); +} + +type timeval = rec(u32 sec, u32 usec); + +fn get_time() -> timeval { + let timeval res = rec(sec=0u32, usec=0u32); + rustrt.get_time(res.sec, res.usec); + ret res; +} + -- cgit v1.2.3