.. include:: Timers, And Timer Callbacks =========================== .. topic:: Documentation * :doc:`../why-os/timer` Time Callback ------------- * On expiry, a specified function is called * *Caution*: not in schedulable context * |longrightarrow| **Cannot wait!** Oneshot Timer ------------- * Expires once, at *start-time* .. literalinclude:: code/oneshot.cpp :caption: :download:`code/oneshot.cpp` :language: c++ Periodic Example ---------------- * Starts at *start-time*, and from then on once every *period* .. literalinclude:: code/periodic.cpp :caption: :download:`code/periodic.cpp` :language: c++