-.. code-block:: c
-
- /* load timer0, every second, on main lcore, reloaded automatically */
-
- hz = rte_get_hpet_hz();
-
- lcore_id = rte_lcore_id();
-
- rte_timer_reset(&timer0, hz, PERIODICAL, lcore_id, timer0_cb, NULL);
-
- /* load timer1, every second/3, on next lcore, reloaded manually */
-
- lcore_id = rte_get_next_lcore(lcore_id, 0, 1);
-
- rte_timer_reset(&timer1, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
+.. literalinclude:: ../../../examples/timer/main.c
+ :language: c
+ :start-after: Load timer0, every second, on main lcore, reloaded automatically. 8<
+ :end-before: >8 End of two timers configured.
+ :dedent: 1