about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorChris Peterson <cpeterson@mozilla.com>2012-02-18 01:27:10 -0800
committerChris Peterson <cpeterson@mozilla.com>2012-02-18 01:30:12 -0800
commit105b5f0be8364ae99d2ce0c7641fcfd16afabbad (patch)
treed09ac6786e4dbdec73d2db2f42a29e5f3d1ea622 /src/libstd
parent123a920f598ddf1bbf07faace11cf9b9fadaa151 (diff)
downloadrust-105b5f0be8364ae99d2ce0c7641fcfd16afabbad.tar.gz
rust-105b5f0be8364ae99d2ce0c7641fcfd16afabbad.zip
std: Expand doc comments for time module
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/time.rs29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/libstd/time.rs b/src/libstd/time.rs
index 2865666fdc8..e945b439115 100644
--- a/src/libstd/time.rs
+++ b/src/libstd/time.rs
@@ -2,18 +2,25 @@
 Module: time
 */
 
-// FIXME: Document what these functions do
-
 #[abi = "cdecl"]
 native mod rustrt {
     fn get_time(&sec: u32, &usec: u32);
     fn nano_time(&ns: u64);
 }
 
-/* Type: timeval */
+/*
+Type: timeval
+
+A record specifying a time value in seconds and microseconds.
+*/
 type timeval = {sec: u32, usec: u32};
 
-/* Function: get_time */
+/*
+Function: get_time
+
+Returns the current time as a `timeval` containing the seconds and
+microseconds since 1970-01-01T00:00:00Z.
+*/
 fn get_time() -> timeval {
     let sec = 0u32;
     let usec = 0u32;
@@ -21,10 +28,20 @@ fn get_time() -> timeval {
     ret {sec: sec, usec: usec};
 }
 
-/* Function: precise_time_ns */
+/*
+Function: precise_time_ns
+
+Returns the current value of a high-resolution performance counter
+in nanoseconds since an unspecified epoch.
+*/
 fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::nano_time(ns); ret ns; }
 
-/* Function: precise_time_s */
+/*
+Function: precise_time_s
+
+Returns the current value of a high-resolution performance counter
+in seconds since an unspecified epoch.
+*/
 fn precise_time_s() -> float {
     ret (precise_time_ns() as float) / 1000000000.;
 }