Updated with interupts | |
Updated with system calls |
The timer on the first line is updated using
interupts. It's probably not a good way to update
a clock, but it is a good example on how to use
interrupts to animate something.
The timer on the second line is updated using system calls to the time functions. That is probably a better way to write the code if you are interested in keeping the correct time. I ran this program for about an hour on one PC and the first clock got behind by a few seconds. I also created this page which gets the server clock and displays it with AJAX code. And last but not least are is this page which does the same thing but gets the clock information as XML. |