Mail Archives: djgpp/1999/02/21/16:27:41
Eli Zaretskii wrote:
>
> On Thu, 18 Feb 1999, Richard Legner wrote:
>
> > while the values produced by uclock() follow a general ascending trend,
> > they are by no means in order.
> > What could be causing this?
>
> Windows, of course. You didn't say, but from the description I'm
> guessing that you are running it from Windows 9X. If so, it's a known
> problem for which no real cure is known: `uclock' reprograms the
> system timer, but Windows resists this.
Yes, Windows 95.
>
> One possible solution is to add this line in the [386Enh] section of
> your SYSTEM.INI file:
>
> TrapTimerPorts=OFF
>
> After adding this line, reboot and see if it helps. In any case,
> please tell here if this setting has any effect on the behavior of
> `uclock'.
It seems to have helped to a certain degree. The first time uclock() is
called it defaults to zero (this works fine), the next few times (10 or
so) uclock() is called in the program, the values are randomly negative
(this happens consistently). After that it seems to stabilize and
produce reasonable values. The keyword here is _seems_, because when I
use uclock to time my routines, it still sometimes produces values the
are clearly unreasonable.
So in conclusion of my little experiment I cannot safely say that I
have or have not fixed the problem, or even a part of it, as the
behaviour before this
attempted fix was not _consistently_ faulty.
I have also changed the ticks data type to ucloct_t (as some people
suggested) to avoid possible wrapping of values, but I don't think this
was ever an issue.
This does not mean that I have fixed the problem as the behaviour before
this attempted fix was not _consistently_ faulty.
Thanks for the help,
cheers
Richard
- Raw text -