# SleepUntilTime

Enters wait state until a specified audio time.

### Synopsis

`Err SleepUntilTime (Item Cue, AudioTime Time)`

### Description

This function will not return until the specified audio time is reached. If that time has already passed, it will return immediately. If it needs to wait, your task will enter wait state so that it does not consume CPU time.

### Arguments

Cue
  The item number of the cue

Time
  Audio time to wait for

### Return Value

The function returns a non-negative value if successful or an error code (a negative value) if an error occurs.

### Implementation

Folio call implemented in Audio folio V20.

### Examples

`

    // If you want to wait for a specific number of ticks to go by,
    // you can get the current audio time from GetAudioTime() and
    // add your delay:
    SleepUntilTime (cue, GetAudioTime() + DELAYTICKS);

`

### Associated Files

audio.h

### See Also

``SignalAtTime`(), CreateCue(), GetCueSignal(), GetAudioTime(), GetAudioRate()`