Lines Matching +full:system +full:- +full:wide
1 // SPDX-License-Identifier: GPL-2.0
10 //! - The [`Instant`] type represents a specific point in time.
11 //! - The [`Delta`] type represents a span of time.
50 pub fn msecs_to_jiffies(msecs: Msecs) -> Jiffies {
72 fn ktime_get() -> bindings::ktime_t;
77 /// A nonsettable system-wide clock that represents monotonic time since as
79 /// point corresponds to the number of seconds that the system has been
83 /// CLOCK_REAL (e.g., if the system administrator manually changes the
85 /// count time that the system is suspended.
91 fn ktime_get() -> bindings::ktime_t {
97 /// A settable system-wide clock that measures real (i.e., wall-clock) time.
100 /// affected by discontinuous jumps in the system time (e.g., if the system
104 /// number of seconds since 1970-01-01 00:00:00 Coordinated Universal Time
116 fn ktime_get() -> bindings::ktime_t {
122 /// A monotonic that ticks while system is suspended.
124 /// A nonsettable system-wide clock that is identical to CLOCK_MONOTONIC,
125 /// except that it also includes any time that the system is suspended. This
126 /// allows applications to get a suspend-aware monotonic clock without
134 fn ktime_get() -> bindings::ktime_t {
142 /// A system-wide clock derived from wall-clock time but counting leap seconds.
156 fn ktime_get() -> bindings::ktime_t {
175 fn clone(&self) -> Self {
185 pub fn now() -> Self {
196 pub fn elapsed(&self) -> Delta {
197 Self::now() - *self
201 pub(crate) fn as_nanos(&self) -> i64 {
205 /// Create an [`Instant`] from a `ktime_t` without checking if it is non-negative.
216 pub(crate) unsafe fn from_ktime(ktime: bindings::ktime_t) -> Self {
233 fn sub(self, other: Instant<C>) -> Delta {
235 nanos: self.inner - other.inner,
244 fn add(self, rhs: Delta) -> Self::Output {
264 fn sub(self, rhs: Delta) -> Self::Output {
267 let res = self.inner - rhs.nanos;
294 fn add(self, rhs: Self) -> Self {
312 fn sub(self, rhs: Self) -> Self::Output {
314 nanos: self.nanos - rhs.nanos,
322 self.nanos -= rhs.nanos;
330 fn mul(self, rhs: i64) -> Self::Output {
348 fn div(self, rhs: Self) -> Self::Output {
368 /// The `micros` can range from -9_223_372_036_854_775 to 9_223_372_036_854_775.
372 pub const fn from_micros(micros: i64) -> Self {
380 /// The `millis` can range from -9_223_372_036_854 to 9_223_372_036_854.
384 pub const fn from_millis(millis: i64) -> Self {
392 /// The `secs` can range from -9_223_372_036 to 9_223_372_036.
396 pub const fn from_secs(secs: i64) -> Self {
404 pub fn is_zero(self) -> bool {
410 pub fn is_negative(self) -> bool {
416 pub const fn as_nanos(self) -> i64 {
423 pub fn as_micros_ceil(self) -> i64 {
426 self.as_nanos().saturating_add(NSEC_PER_USEC - 1) / NSEC_PER_USEC
432 bindings::ktime_to_us(self.as_nanos().saturating_add(NSEC_PER_USEC - 1))
438 pub fn as_millis(self) -> i64 {
456 pub fn rem_nanos(self, dividend: i32) -> Self {