Expand description
Time related primitives.
This module contains the kernel APIs related to time and timers that have been ported or wrapped for usage by Rust code in the kernel.
There are two types in this module:
Note that the C side uses ktime_t
type to represent both. However, timestamp
and timedelta are different. To avoid confusion, we use two different types.
A Instant
object can be created by calling the Instant::now()
function.
It represents a point in time at which the object was created.
By calling the Instant::elapsed()
method, a Delta
object representing
the elapsed time can be created. The Delta
object can also be created
by subtracting two Instant
objects.
A Delta
type supports methods to retrieve the duration in various units.
C header: include/linux/jiffies.h
.
C header: include/linux/ktime.h
.
Modules§
- Intrusive high resolution timers.
Structs§
- A span of time.
- A specific point in time.
Enums§
- An identifier for a clock. Used when specifying clock sources.
Constants§
- The number of nanoseconds per millisecond.
- The number of nanoseconds per second.
- The number of nanoseconds per microsecond.
Functions§
- Converts milliseconds to jiffies.
Type Aliases§
- The time unit of Linux kernel. One jiffy equals (1/HZ) second.
- The millisecond time unit.