Einzelnen Beitrag anzeigen

QuickAndDirty

Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
1.889 Beiträge
 
Delphi 12 Athens
 
#4

AW: Keine Zulässige Win32-Anwendung seit Delphi11

  Alt 7. Feb 2022, 10:16
Auf den ersten Blick ist es auch nicht notwendig Threading zu fixen, da Emba das schon berücksichtigt.

Delphi-Quellcode:
class function TThread.GetTickCount: Cardinal;
{$IF Defined(MSWINDOWS)}
begin
  Result := Winapi.Windows.GetTickCount;
end;
{$ELSE}
begin
  Result := Cardinal(GetTickCount64);
end;
{$ENDIF}

class function TThread.GetTickCount64: UInt64;
{$IF Defined(MSWINDOWS)}
begin
  if TOSVersion.Major >= 6 then Result := Winapi.Windows.GetTickCount64 else Result := Winapi.Windows.GetTickCount;
end;
{$ELSEIF Defined(MACOS)}
begin
  Result := AbsoluteToNanoseconds(mach_absolute_time) div 1000000;
end;
{$ELSEIF Defined(POSIX)}
var
  res: timespec;
begin
  clock_gettime(CLOCK_MONOTONIC, @res);
  Result := UInt64(1000 * res.tv_sec + res.tv_nsec div 1000000);
end;
{$ELSE OTHERPLATFORM}
  {$MESSAGE Fatal 'Method not implemented for Platform'}
{$ENDIF OTHERPLATFORM}
Andreas
Monads? Wtf are Monads?
  Mit Zitat antworten Zitat