unit l_utils;
(*************************************)
(* Utils module by XProger           *)
(*************************************)
(* site : http://XProger.mirgames.ru *)
(* mail : XProger@list.ru            *)
(*************************************)
interface

uses
 Windows;

type
 PByteArray = ^TByteArray;
 TByteArray = array [0..1] of Byte;

 PWordArray = ^TWordArray;
 TWordArray = array [0..1] of Word;

 function GetTimer: integer;
 function IntToStr(x: integer): string;
 function FileExists(FileName: string): boolean;

implementation

// Точное значение таймера
function GetTimer: integer;
var
 T, F : LARGE_INTEGER;
begin
QueryPerformanceFrequency(int64(F));
QueryPerformanceCounter(int64(T));
Result := trunc(1000 * T.QuadPart/F.QuadPart);
end;

// целое в строку
function IntToStr(x: integer): string;
begin
Str(x, Result);
end;

function FileExists(FileName: string): boolean;
var
 F: File;
begin
FileMode := 64;
AssignFile(F, FileName);
{$I-}
Reset(F);
{$I+}
Result:=IOResult=0;
if Result then
 CloseFile(F);
end;


end.
