std1.0.0-beta-7 SafeC docs

std :: async::executor

Struct std::VirtualClock

#include <std/async/executor.h> source

struct VirtualClock {
    long long now;
    long long parked;
}

Simulated time: park(t) moves the clock forward by t instead of waiting, so a run takes no real time and is fully deterministic. park(-1) — every task waits and no timer is pending — is a deadlock in a program that has no other threads or interrupts, and panics.

Fields

§long long nowsource
§long long parkedsource

how many times it parked

Methods

§static struct VirtualClock new(long long start_ms)source · definition
§long long now_ms()source · definition
§void park(long long timeout_ms)source · definition
§void unpark()source · definition