开发者

Convert function delayticks (Delphi) to Java

开发者 https://www.devze.com 2023-03-28 04:44 出处:网络
I\'m working to translate a software source code from Delphi to Java. I have problems translating the function DelayTicks(long delay, bool tick)

I'm working to translate a software source code from Delphi to Java. I have problems translating the function DelayTicks(long delay, bool tick)

Does anyone know the possible solution? Exists some function of java that is right for me

Thank you so much all!

EDIT: the Delphi system procedure is the following -

  function DelayTicks(Ticks : LongInt; Yield : Bool) : LongInt;
      {-Delay for Ticks ticks}
    var
      ET : EventTimer;
      Res : LongInt;
    begin
      if Ticks <= 0 then begin
        DelayTicks := 0;
        Exit;
      end else if Ticks > MaxTicks then
        Ticks := MaxTicks;

      Res := 0;
      NewTimer(ET, Ticks);
      repeat
        if Yield then
          Res := SafeYield;
      until (Res = wm_Quit) or开发者_JS百科 TimerExpired(ET);
      DelayTicks := Res;
    end;

I think that the boolean parameter "Yield" is for async or sync delay.

0

精彩评论

暂无评论...
验证码 换一张
取 消