System Trap - Sleep until a given time.
kern_return_t clock_sleep (mach_port_t clock_name, sleep_type_t sleep_type, tvalspec_t sleep_time, clock_name wake_time);
The clock_sleep system trap delays the invoking thread until a specified time. This sleep may be aborted by thread_abort. Not all clocks provide this service but the REALTIME clock must.
If the specified time is in the past, the call returns immediately with the wake time being the current time. If the clock's time is changed (clock_set_time), the sleep will be interrupted. The thread will waken at the service time nearest the specified sleep time as governed by the current clock alarm resolution.
Functions: host_get_clock_service, clock_get_attributes, clock_get_time, clock_alarm, clock_set_time, thread_abort,
Data Structures: tvalspec.