Thursday, 4 December 2014

Timers could be used to compute the current time. Provide a short description of how this could be accomplished.

A program could use the following approach to compute the current time using timer interrupts. The program could set a timer for some time in the future and go to sleep. When it is awakened by the interrupt, it could update its local state, which it is using to keep track of the number of interrupts it has received thus far. It could then repeat this process of continually setting timer interrupts and updating its local state when the interrupts are actually raised.

No comments:

Post a Comment