This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC1350: When to use clocks and when to use timers?

Part Number: CC1350

Tool/software: TI-RTOS

In the past I've based my use of clocks on the examples from the sub-GHz wireless sensor network/easylink examples. It feels a little wrong that I am doing a clock_construct for every new timing need that I have, and I wonder if perhaps some things I am timing would be better suited to using a timer rather than a clock.

So in what situations are timers preferred over clocks or vice versa? 

For a periodic transmission, would I use a clock or a timer? How about to measure how long a button had been pressed for?

  • It is recommended to use the clock module. The Timer module in TI RTOS is a generic module providing access to timing services in the OS. This Timer kernel module implements the needed functions for others to access OS timing services.
    The OS “Clock” module uses the kernel Timer module to provide “clocks”, either periodic or one-shot.
  • Okay, so there should never be a need to use a timer I suppose. Thanks.

    Quick follow up question, clock related...

    If i use Clock_stop() before a clock gets to the end of a period/timeout, and then Clock_start() shortly after, will the clock re-start with the same time it was stopped at left, or will it re-load its parameters and run the whole period again?