The base timer itself is driven by the timer source on a different thread. However, because developers can provide alternative reference timers, it is possible to use an external time source such as an audio and video playback component. This ensures that the entire system stays in sync with external media. Timers can have their reference timer switched at any time, eliminating any potential problems with the availability of a reference timer. Reference timers may also be used to provide debugging support by stepping through timer callbacks one at a time.
Local synchronization is achieved by allowing the clock to be temporarily frozen.
This can be done explicitly from a control or a script, or implicitly by the container. The container freezes the clock when it is painting or when servicing several callbacks at the same time. Controls or scripts freeze the clock when executing actions that have timed behavior. For example, if a script needs to start a video and an audio clip simultaneously, it should freeze the clock, issue the commands, and then restart the clock. When the clock is frozen, the reported time stops changing and callbacks are suspended.