# Setting on-board timers

The CDI service supports one on-board timer per context on a CX board. You can set up this timer to run for a specified amount of time and then expire, returning an event to the application. Alternatively, you can configure the timer to tick, generating a specified number of tick events at a periodic rate before expiring.

To set up the timer, invoke cdiStartTimer. The timer has a 2 ms resolution.

You can abort a timer by invoking cdiStopTimer. cdiStopTimer returns SUCCESS if successfully invoked. When the timer is stopped, CDIEVN_TIMER_DONE is generated. The value field of this event contains CTA_REASON_STOPPED. If you invoke cdiStopTimer when the timer has already stopped, CDIEVN_TIMER_STOPPED is generated.