Mail Archives: djgpp/1998/05/08/00:00:48
On Thu, 07 May 1998 17:06:35 +0100, Johan van Ooijen
<J DOT W DOT vanOOIJEN AT CPRO DOT DLO DOT NL> wrote:
> Just today I got the results of simulations that ran on a PC, for which
> I am very sure that was not finished before last tuesday; I saw the
> program still active on monday. However, in the results-output-file it
> mentions that the program was finished already on the thursday morning,
> several days earlier!! The date of this file is identical (!!) to the
> date mentioned in the file. So I suspect that one way or another the
> internal clock is affected by the program, but as it seems not
> systematically. MSDOS must use the same clock for the date of the file.
PCs/DOS have many clocks: one of them is the real time clock (RTC),
another one is the BIOS/DOS clock which is initialized at boot time and
then incremented every once in a while by the interrupt 9 handler. If
you let your computer run for days, this DOS clock will run all on its
own and never get re-synchronized; and it's not really accurate. The
time() function (at least the one from DJGPP v2.01) uses the DOS clock.
Try using uclock() instead, if DJGPP 1.x has this or if you can upgrade
to v2.01.
Alternatively, get a program that sets the DOS clock according to the
RTC. One of these programs is atrtc.sys, which comes with Kris
Heidenstrom's PC Timing FAQ (pctim003.zip, on SimTel mirrors). You need
at least a PC-AT for this, because there is no RTC in PC-XTs or plain
PCs - you never know, if you're still using gcc 2.6.0 ;-)
Regards...
Michael
- Raw text -