Nachos provides a Timer object that simulates a real time clock, generating interrupts at regular intervals. It is implemented using the same event driven interrupt mechanism described above. Timer supports the following operations:
To add a bit of non-determinism to the system, argument doRandom specifies that the time between interrupts should be taken from a uniform interval between 1 and .
The real-time clock can be used to provide preemption.
Note that starting Nachos with the ``-rs'' option creates a timer object that interrupts at random intervals and preempts the currently running thread.