From: "Rob Kramer" Newsgroups: comp.os.msdos.djgpp References: <3a8ca532$1 AT news DOT starhub DOT net DOT sg> <7458-Fri16Feb2001081657+0200-eliz AT is DOT elta DOT co DOT il> <3a8cd661$1 AT news DOT starhub DOT net DOT sg> <1659-Fri16Feb2001123414+0200-eliz AT is DOT elta DOT co DOT il> Subject: Re: System clock problem. Date: Fri, 16 Feb 2001 21:04:40 +0800 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 203.117.157.106 Message-ID: <3a8d25a8$1@news.starhub.net.sg> X-Trace: 16 Feb 2001 21:05:44 +0800, 203.117.157.106 Organization: StarHub Internet Pte Ltd To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Eli Zaretskii" wrote in message news:1659-Fri16Feb2001123414+0200-eliz AT is DOT elta DOT co DOT il... > > From: "Rob Kramer" > > Newsgroups: comp.os.msdos.djgpp > > Date: Fri, 16 Feb 2001 15:18:41 +0800 > > > > Correct, there's about 50 of these devices (embedded PCs). 3 are starting to > > show the problem now. I'm suspecting a hardware problem, but can't explain > > why all is fine again after I exit my application. > > Based on your description, I won't suspect the hardware first, because > the system clock is evidently okay once you exit the program. > > What other time-related functions or interrupts does that program use? > Does it delay itself, for example, or use usleep? Lots of delays and timings yes, but they are all derived from a 5ms Allegro timer, which reprograms one of the hardware timer/counters. I use the Allegro timer interrupt to add 5 to a global counter, so I have a millisecond counter with 5ms precision. All timings are done by using that counter. No usleep used. The clock-string written to the screen is directly converted from time(), using my own conversion routine (strftime() was not suitable for 'historical reasons'). Going through the code, there's no way a clock speedup could be introduced here.. Thanks, Rob