Skip to main content

Module clock

Module clock 

Source

Re-exportsΒ§

use std::cell::Cell; πŸ”’
use std::time::Duration; πŸ”’
use std::time::Instant as StdInstant; πŸ”’
use std::time::SystemTime; πŸ”’
use crate::MiriMachine; πŸ”’

StructsΒ§

Instant
An instant (a fixed moment in time) in Miri’s monotone clock.
MonotonicClock
A monotone clock used for Instant simulation.

EnumsΒ§

Deadline
A deadline for some event to occur.
InstantKind πŸ”’
MonotonicClockKind πŸ”’
TimeoutClock
The clock to use for the timeout you are asking for.
TimeoutStyle
Whether the timeout is relative or absolute.

ConstantsΒ§

NANOSECONDS_PER_BASIC_BLOCK πŸ”’
When using a virtual clock, this defines how many nanoseconds we pretend are passing for each basic block. This number is pretty random, but it has been shown to approximately cause some sample programs to run within an order of magnitude of real time on desktop CPUs. (See tests/pass/shims/time-with-isolation*.rs.)