delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/02/17/02:02:38

Date: Sat, 17 Feb 2001 08:54:36 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Rob Kramer" <robk AT cyberway DOT com DOT sg>
Message-Id: <3405-Sat17Feb2001085436+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp AT delorie DOT com
In-reply-to: <3a8d25a8$1@news.starhub.net.sg> (robk@cyberway.com.sg)
Subject: Re: System clock problem.
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> <3a8d25a8$1 AT news DOT starhub DOT net DOT sg>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Rob Kramer" <robk AT cyberway DOT com DOT sg>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 16 Feb 2001 21:04:40 +0800
> 
> 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.

I don't know enough about Allegro to tell whether its timers can
possibly have such an effect.  But that would be the first direction
in which I'd look.

Does Allegro do something to the system clock/timers when the program
exits?  If it does, perhaps that could explain why the system clock is
okay once you exit.

You try to invoke some external program that prints the system time
from your program, to see whether the apparent speedup is something
internal to your program or whether the system clock really runs
faster.

> The clock-string written to the screen is directly converted from time(),
> using my own conversion routine (strftime() was not suitable for 'historical
> reasons').

It might be useful to print the unconverted value returned from
time(), and see if it indeed changes at faster rate than it should.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019