diff options
| author | Patrick Walton <[email protected]> | 2011-04-29 11:54:06 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-04-29 11:54:06 -0700 |
| commit | 5d3e5531412952c556fabb541536bcae34b0ce09 (patch) | |
| tree | fabf066bf9227a0026be2e2b62f2012e9d32ee14 /src/lib | |
| parent | rustc: Remove the wrong-compiler warning; we're self-hosting now. (diff) | |
| download | rust-5d3e5531412952c556fabb541536bcae34b0ce09.tar.xz rust-5d3e5531412952c556fabb541536bcae34b0ce09.zip | |
stdlib: Add a Time module to the standard library
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Time.rs | 12 | ||||
| -rw-r--r-- | src/lib/std.rc | 1 |
2 files changed, 13 insertions, 0 deletions
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; +} + diff --git a/src/lib/std.rc b/src/lib/std.rc index 4efff14b..44a0689c 100644 --- a/src/lib/std.rc +++ b/src/lib/std.rc @@ -76,6 +76,7 @@ mod ExtFmt; mod Box; mod GetOpts; mod Term; +mod Time; // Local Variables: // mode: rust; |