Преглед изворни кода

* GetTickCount(64) implementation for OS/2 added

git-svn-id: trunk@23239 -
Tomas Hajny пре 12 година
родитељ
комит
2f25717e67
1 измењених фајлова са 27 додато и 0 уклоњено
  1. 27 0
      rtl/os2/sysutils.pp

+ 27 - 0
rtl/os2/sysutils.pp

@@ -40,6 +40,8 @@ type
 {$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
 {$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
 {$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
 {$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
 {$DEFINE FPC_FEXPAND_GETENV_PCHAR}
 {$DEFINE FPC_FEXPAND_GETENV_PCHAR}
+{$DEFINE HAS_GETTICKCOUNT}
+{$DEFINE HAS_GETTICKCOUNT64}
 
 
 { Include platform independent implementation part }
 { Include platform independent implementation part }
 {$i sysutils.inc}
 {$i sysutils.inc}
@@ -647,6 +649,13 @@ begin
  DosSleep (Milliseconds);
  DosSleep (Milliseconds);
 end;
 end;
 
 
+function SysTimerTick: QWord;
+var
+  L: cardinal;
+begin
+  DosQuerySysInfo (svMsCount, svMsCount, L, 4);
+  SysTimerTick := L;
+end;
 
 
 function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString;Flags:TExecuteFlags=[]):
 function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString;Flags:TExecuteFlags=[]):
                                                                        integer;
                                                                        integer;
@@ -809,6 +818,24 @@ begin
 end;
 end;
 
 
 
 
+function GetTickCount: LongWord;
+var
+  L: cardinal;
+begin
+  DosQuerySysInfo (svMsCount, svMsCount, L, 4);
+  GetTickCount := L;
+end;
+
+
+function GetTickCount64: QWord;
+var
+  L: cardinal;
+begin
+  DosQuerySysInfo (svMsCount, svMsCount, L, 4);
+  GetTickCount64 := L;
+end;
+
+
 
 
 {****************************************************************************
 {****************************************************************************
                               Initialization code
                               Initialization code