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.
精彩评论