The current time is held as a 32 bit value in the ctl_current_time variable

You can atomically read this variable using the ctl_get_current_time function on systems whose word size is not 32 bit.

You can suspend execution of a task for a fixed period using the ctl_timeout_wait function.

Note that this function takes the timeout not the duration as a parameter, so you should always call this function with ctl_get_current_time()+duration.

    ctl_timeout_wait(ctl_get_current_time()+100);

This example suspends execution of the calling task for 100 increments of the ctl_current_time variable.

To use the timer support functions of the tasking library you must enable a periodic interrupt service routine that calls the ctl_increment_tick_from_isr function.