delay(); being innacurate! 
Author Message
 delay(); being innacurate!

Is it agreed that running the following program, should take 60 seconds,
right?

Program LongDistance;

Uses
    Dos, Crt, Printer;

Var
   X : Integer;

Begin
     ClrScr;
     For X := 1 to 60 do
         Begin
           Writeln('Second -> ',X);
           Delay(1000);
         End;
End.

Wrong, each time I run it on my computer, it is exactly 33 seconds, very
strange.  Is it just me?  IF I give this program to someone else will it be
different?  What can I do? Please help!

Kevin Jarrett

http://www.*-*-*.com/ ~phunistl



Wed, 18 Jun 1902 08:00:00 GMT  
 delay(); being innacurate!
:Is it agreed that running the following program, should take 60 seconds,
:right?

Are you using TP 6.0? If the delays you need are not very short try
DosDelay in

 112024 Aug 16 21:31 ftp://garbo.uwasa.fi/pc/ts/tspa3460.zip
 tspa3460.zip Turbo Pascal 6.0 units for (real:-) programmers, T.Salmi

and see if it helps.

   All the best, Timo

....................................................................

Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa



Wed, 18 Jun 1902 08:00:00 GMT  
 delay(); being innacurate!
                                                 02 Apr 96

Hi folks,



 p> Is it agreed that running the following program, should take 60 seconds,
 p>
 p>            Delay(1000);
 p>
 p> Wrong, each time I run it on my computer, it is exactly 33 seconds, very
 p> strange.  Is it just me?

 No, it has to do with the way, they determin the systems speed. The
 procdeure Delay is nothing more than a counting loop with a special
 value that should represent a milli second. This value is determind by
 program start. It uses the dos tick. And this is where it gets
 inaccurate (refer to the RTL CRT Unit Source Code for details).

 p> If I give this program to someone else will it
 p> be different?

 Yes, it depends on the systemconfiguration. If you use very much TSR
 and other IRQ and INT consuming jobs, this function will get very
 vague.

 cu

 Hendrik



Wed, 18 Jun 1902 08:00:00 GMT  
 delay(); being innacurate!
delay(2000) is equal (or just about) to a second, delay(1000) is about
0.5 seconds.

http://www.ac.net/~hneely/

Quote:

>Is it agreed that running the following program, should take 60 seconds,
>right?
>Program LongDistance;
>Uses
>    Dos, Crt, Printer;
>Var
>   X : Integer;
>Begin
>     ClrScr;
>     For X := 1 to 60 do
>         Begin
>           Writeln('Second -> ',X);
>           Delay(1000);
>         End;
>End.
>Wrong, each time I run it on my computer, it is exactly 33 seconds, very
>strange.  Is it just me?  IF I give this program to someone else will it be
>different?  What can I do? Please help!
>Kevin Jarrett

>http://www.dfw.net/~phunistl



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. DBLookupCombo - Documentation/Am I mad?

2. I am really sorry

3. What am I doing wrong...

4. I am stuck - TDecisionQuery AV in SQLORA8.DLL

5. WHAT DBGRID FIELD AM I

6. IndexDefs - am I using the right property?

7. Desperate for help...What am I missing?

8. Am I hitting the Limit here?

9. SQL - Where am I wrong?

10. HELP : I am stuck ! DBGrid (D1)

11. Losing File Handles - But I am not using Files

12. Am I in protected mode?

 

 
Powered by phpBB® Forum Software