TIMER inaccuracy on 486/Pentium

General FreeBASIC programming questions.
Post Reply
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

TIMER inaccuracy on 486/Pentium

Post by DamageX »

I discovered that TIMER is inaccurate in certain cases. It only happened when using a graphics mode, under DOS on my 486, and under DOS and Windows NT on my Pentium MMX. However the problem was not apparent under Windows 98 on the Pentium MMX, or Windows NT on a Pentium M.

During 30 real seconds, the TIMER function would only count 15-25 seconds.
DOS386
Posts: 798
Joined: Jul 02, 2005 20:55

Re: TIMER inaccuracy on 486/Pentium

Post by DOS386 »

DamageX wrote:I discovered that TIMER is inaccurate in certain cases.
Not really: http://www.freebasic.net/wiki/wikka.php ... KeyPgTimer

> During 30 real seconds, the TIMER function would only count 15-25 seconds.

Bad if true. Please supply a complete testcase.

> It only happened when using a graphics mode, under DOS on my 486, and under DOS
> and Windows NT on my Pentium MMX.
> However the problem was not apparent under Windows 98 on the
> Pentium MMX, or Windows NT on a Pentium M.

486 -> no RDTSC available
Windaube NT -> no RDTSC usage ???
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

Re: TIMER inaccuracy on 486/Pentium

Post by DamageX »

The problem shows up when SCREENLOCK is used. Does SCREENLOCK block interrupts in DOS?

Code: Select all

dim t as double
screen 18,8
do
t=timer
screenlock
locate 1,1,0:? t
screenunlock
loop until inkey$<>""
Post Reply