Mail Archives: djgpp/1997/12/17/05:01:19
On Tue, 16 Dec 1997, Dim Zegebart wrote:
> And then call settime() to synchronize real and system timers.
>
> { struct time now;
> real_time_clock(0,&now);
> settime(&now);
> }
> Everething is Ok until midnight - then time is 0:0:0 settime() increase
> the date but then the time become 0:0:1 it sets date to the old
> value :( What is my problem and how can I solve it ?
I'm not sure what problem are you trying to solve with the above code.
AFAIK, in DOS 3.3 and later, `settime' will also set the time
maintained in the CMOS clock. So your code is constantly slowing down
the system clock (due to the time that passes between the two calls).
It's probably not what you want, and it even might be the reason
behind the strange effects around midnight.
I suggest to try the BIOS call for setting the system time instead
(either the Borland-like `biostime' or the MS-like `_bios_timeofday'
function).
- Raw text -