17.10. Timers

Count from 0 to 9 infinitely many times in 1 second intervals using timers:

insmod timer.ko

Stop counting:

rmmod timer

Timers are callbacks that run when an interrupt happens, from the interrupt context itself.

Therefore they produce more accurate timing than thread scheduling, which is more complex, but you can’t do too much work inside of them.

Bibliography: