Skip to content

Commit 789b735

Browse files
committed
---
yaml --- r: 14367 b: refs/heads/try c: 105b5f0 h: refs/heads/master i: 14365: c3adfff 14363: 8640334 14359: d004fc3 14351: aacca26 14335: 4cc2ad4 v: v3
1 parent 1cc9037 commit 789b735

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 123a920f598ddf1bbf07faace11cf9b9fadaa151
5+
refs/heads/try: 105b5f0be8364ae99d2ce0c7641fcfd16afabbad
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libstd/time.rs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,46 @@
22
Module: time
33
*/
44

5-
// FIXME: Document what these functions do
6-
75
#[abi = "cdecl"]
86
native mod rustrt {
97
fn get_time(&sec: u32, &usec: u32);
108
fn nano_time(&ns: u64);
119
}
1210

13-
/* Type: timeval */
11+
/*
12+
Type: timeval
13+
14+
A record specifying a time value in seconds and microseconds.
15+
*/
1416
type timeval = {sec: u32, usec: u32};
1517

16-
/* Function: get_time */
18+
/*
19+
Function: get_time
20+
21+
Returns the current time as a `timeval` containing the seconds and
22+
microseconds since 1970-01-01T00:00:00Z.
23+
*/
1724
fn get_time() -> timeval {
1825
let sec = 0u32;
1926
let usec = 0u32;
2027
rustrt::get_time(sec, usec);
2128
ret {sec: sec, usec: usec};
2229
}
2330

24-
/* Function: precise_time_ns */
31+
/*
32+
Function: precise_time_ns
33+
34+
Returns the current value of a high-resolution performance counter
35+
in nanoseconds since an unspecified epoch.
36+
*/
2537
fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::nano_time(ns); ret ns; }
2638

27-
/* Function: precise_time_s */
39+
/*
40+
Function: precise_time_s
41+
42+
Returns the current value of a high-resolution performance counter
43+
in seconds since an unspecified epoch.
44+
*/
2845
fn precise_time_s() -> float {
2946
ret (precise_time_ns() as float) / 1000000000.;
3047
}

0 commit comments

Comments
 (0)