Jump to content



Photo

Wait() Function For Luazm

LuaZM wait

  • Please log in to reply
No replies to this topic

#1 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 20 November 2012 - 10:40 AM

I made a simple wait() function for LuaZM, in case anyone needs one. :)

--place the following line of code at the beginning of the program
local startTime = zmg.ticks()

local function timeElapsed()
return math.floor((zmg.ticks()-startTime)/128)
end

local function wait(timeToWait)
local start = timeElapsed()
while timeElapsed() - start < timeToWait do end
end




Also tagged with one or more of these keywords: LuaZM, wait

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users