(*********************************************)
(* Name: RAW_Timer                           *)
(* Last Revision: 28 may 2000                *)
(* Version: 1.1                              *)
(*                                           *)
(* Copyright © 2000 - Christian Aaangel      *)
(*********************************************)

Unit RAW_Timer;

interface

Uses
 SysUtils,
 StdCtrls,
 Graphics,
 Forms;

Function RAW_Timer_Version: String;
Function RAW_Timer_Date: String;
Function E(EE: Integer): Real; // Works like EE
Function Timer: Real;
Procedure Delay(MSec: Integer);

implementation

Function RAW_Timer_Version: String;
Begin
 Result := '1.0';
End;

Function RAW_Timer_Date: String;
Begin
 Result := '28 may 2000';
End;

Function E(EE: Integer): Real;
Var
 S: String;
 I: Integer;
Begin
 S := '1';
 For I := 1 to EE do S := S + '0';
 Result := StrToFloat(S);
End;

Function Timer: Real;
var
  Present: TDateTime;
  Hour, Min, Sec, MSec: Word;
  Day, Month, Year: Word;
  Res: Real;
Begin
 Present := Now;
 DecodeDate(Present, Year, Month, Day);
 DecodeTime(Present, Hour, Min, Sec, MSec);
 Res := (Year * E(15)) + (Month * E(11)) + (Day * E(9)) +
        (Hour * E(7)) + (Min * E(5)) + (Sec * E(3)) + MSec;
 Result := Res;
End;

Procedure Delay(MSec: Integer);
Var
 Start: Real;
Begin
 Start := Timer;
 While Timer - (Start + MSec) <= 0 do Application.ProcessMessages;
End;

end.
