@@ -59,6 +59,21 @@ pub use core::time::Duration;
59
59
/// println!("{}", now.elapsed().as_secs());
60
60
/// }
61
61
/// ```
62
+ ///
63
+ /// # Underlying System calls
64
+ /// Currently, the following system calls are being used to get the current time using `now()`:
65
+ ///
66
+ /// | Platform | System call |
67
+ /// |:---------:|:------------------------------------------------:|
68
+ /// | Cloud ABI | [clock_time_get (Monotonic Clock)](https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt) |
69
+ /// | SGX | Not implemented |
70
+ /// | UNIX | [mach_absolute_time](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/services/services.html) |
71
+ /// | VXWorks | [clock_gettime (Monotonic Clock)](https://linux.die.net/man/3/clock_gettime) |
72
+ /// | WASI | [__wasi_clock_time_get (Monotonic Clock)](https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md#clock_time_get) |
73
+ /// | Windows | [QueryPerformanceCounter](https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) |
74
+ ///
75
+ /// **Disclaimer:** These system calls might change over time.
76
+ ///
62
77
#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
63
78
#[ stable( feature = "time2" , since = "1.8.0" ) ]
64
79
pub struct Instant ( time:: Instant ) ;
@@ -114,6 +129,21 @@ pub struct Instant(time::Instant);
114
129
/// }
115
130
/// }
116
131
/// ```
132
+ ///
133
+ /// # Underlying System calls
134
+ /// Currently, the following system calls are being used to get the current time using `now()`:
135
+ ///
136
+ /// | Platform | System call |
137
+ /// |:---------:|:------------------------------------------------:|
138
+ /// | Cloud ABI | [clock_time_get (Realtime Clock)](https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt) |
139
+ /// | SGX | Not implemented |
140
+ /// | UNIX | [gettimeofday](http://man7.org/linux/man-pages/man2/gettimeofday.2.html) |
141
+ /// | VXWorks | [clock_gettime (Realtime Clock)](https://linux.die.net/man/3/clock_gettime) |
142
+ /// | WASI | [__wasi_clock_time_get (Realtime Clock)](https://github.com/CraneStation/wasmtime/blob/master/docs/WASI-api.md#clock_time_get) |
143
+ /// | Windows | [GetSystemTimeAsFileTime](https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime) |
144
+ ///
145
+ /// **Disclaimer:** These system calls might change over time.
146
+ ///
117
147
#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
118
148
#[ stable( feature = "time2" , since = "1.8.0" ) ]
119
149
pub struct SystemTime ( time:: SystemTime ) ;
0 commit comments