X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Ftime.rs;h=b2014f462bd34569865955b30ab13d48e222c5b6;hb=98a8035bedd2c660912d1e6ecfe86c895e588feb;hp=2f8eb557b4f74718c98a2bba8d8504d1a608a277;hpb=c6bb219fc4e70365273c8f8cb96fdff2e910bd38;p=rust.git diff --git a/library/std/src/time.rs b/library/std/src/time.rs index 2f8eb557b4f..b2014f462bd 100644 --- a/library/std/src/time.rs +++ b/library/std/src/time.rs @@ -95,13 +95,15 @@ /// use std::time::{Instant, Duration}; /// /// let now = Instant::now(); -/// let max_nanoseconds = u64::MAX / 1_000_000_000; -/// let duration = Duration::new(max_nanoseconds, 0); +/// let max_seconds = u64::MAX / 1_000_000_000; +/// let duration = Duration::new(max_seconds, 0); /// println!("{:?}", now + duration); /// ``` /// /// # Underlying System calls -/// Currently, the following system calls are being used to get the current time using `now()`: +/// +/// The following system calls are [currently] being used by `now()` to find out +/// the current time: /// /// | Platform | System call | /// |-----------|----------------------------------------------------------------------| @@ -113,6 +115,7 @@ /// | WASI | [__wasi_clock_time_get (Monotonic Clock)] | /// | Windows | [QueryPerformanceCounter] | /// +/// [currently]: crate::io#platform-specific-behavior /// [QueryPerformanceCounter]: https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter /// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time /// [timekeeping in SGX]: https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode @@ -203,7 +206,8 @@ /// For example, on Windows the time is represented in 100 nanosecond intervals whereas Linux /// can represent nanosecond intervals. /// -/// Currently, the following system calls are being used to get the current time using `now()`: +/// The following system calls are [currently] being used by `now()` to find out +/// the current time: /// /// | Platform | System call | /// |-----------|----------------------------------------------------------------------| @@ -215,6 +219,7 @@ /// | WASI | [__wasi_clock_time_get (Realtime Clock)] | /// | Windows | [GetSystemTimePreciseAsFileTime] / [GetSystemTimeAsFileTime] | /// +/// [currently]: crate::io#platform-specific-behavior /// [`insecure_time` usercall]: https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.insecure_time /// [timekeeping in SGX]: https://edp.fortanix.com/docs/concepts/rust-std/#codestdtimecode /// [gettimeofday]: https://man7.org/linux/man-pages/man2/gettimeofday.2.html