home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
drcpas10.zip
/
TIMER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-11-17
|
979b
|
45 lines
Unit Timer;
{$A+,B-,D-,F-,I-,L-,O-,R-,S-,V-}
(* by David R. Conrad, for Turbo Pascal 5.5
This code is not copyrighted, you may use it freely.
There are no guarantees, either expressed or implied,
as to either merchantability or fitness for a particular
purpose. The author's liability is limited to the amount
you paid for it.
David R. Conrad, 17 Nov 92
David_Conrad@mts.cc.wayne.edu
dave@michigan.com
*)
Interface
type
{$IFOPT N+}
float = double;
{$ELSE}
float = real;
{$ENDIF}
const
TIX_PER_SECOND : float = 1193180 / 65536;
TIX_PER_DAY = $1800B0;
var
ClockTix : Longint absolute $0040:$006C;
function difftix (start, finish : longint) : longint;
Implementation
function difftix (start, finish : longint) : longint;
(* difference between to clock ticks; handles midnight wraparound *)
begin
if finish < start then finish := finish + TIX_PER_DAY;
difftix := finish - start;
end;
End.