community.borland.com

Article #16287: Timer Program Example

 Technical Notes Database

TN1287D.txt   Timer Program Example
Category   :Pascal
Platform    :All
Product    :Turbo Pascal  5.5

Description:

Example of a timer program in Turbo Pascal 5.5.
It uses the system tick to calculate the time.

Program Timer;

uses CRT;
var 
  Startime:longint;\
  SystemTimer: Longint absolute $0040:$006C

procedure StartTimer;

begin
  Starttime:=SystemTimer;
end;

function TimePassed:real;
begin
  Timepassed := (SystemTimer-Starttime)/18.206759747;
end;

begin
  clrscr;
  StartTimer;
  repeat
    gotoxy(10,10);
    write(TimePassed:15:10);
  until keypressed;
end.
  

11/29/90clb


Reference:


7/16/98 4:35:43 PM
 

Last Modified: 01-SEP-99