File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 123a920f598ddf1bbf07faace11cf9b9fadaa151
5
+ refs/heads/try: 105b5f0be8364ae99d2ce0c7641fcfd16afabbad
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change 2
2
Module: time
3
3
*/
4
4
5
- // FIXME: Document what these functions do
6
-
7
5
#[ abi = "cdecl" ]
8
6
native mod rustrt {
9
7
fn get_time ( & sec: u32 , & usec: u32 ) ;
10
8
fn nano_time ( & ns: u64 ) ;
11
9
}
12
10
13
- /* Type: timeval */
11
+ /*
12
+ Type: timeval
13
+
14
+ A record specifying a time value in seconds and microseconds.
15
+ */
14
16
type timeval = { sec : u32 , usec : u32 } ;
15
17
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
+ */
17
24
fn get_time ( ) -> timeval {
18
25
let sec = 0u32 ;
19
26
let usec = 0u32 ;
20
27
rustrt:: get_time ( sec, usec) ;
21
28
ret { sec : sec, usec : usec} ;
22
29
}
23
30
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
+ */
25
37
fn precise_time_ns ( ) -> u64 { let ns = 0u64 ; rustrt:: nano_time ( ns) ; ret ns; }
26
38
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
+ */
28
45
fn precise_time_s ( ) -> float {
29
46
ret ( precise_time_ns ( ) as float ) / 1000000000. ;
30
47
}
You can’t perform that action at this time.
0 commit comments