S
S
Simt112018-11-10 21:38:57
Lua
Simt11, 2018-11-10 21:38:57

Running code over time in LUA?

There is code in the while true loop do stop os.sleep(1)
how to implement timed work once per second?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Simt11, 2018-11-11
@Simt11

I decided myself. Checking for time changes helped:

while true do
  if Core.c+1 <= os.clock() then
    Core.c = math.modf(os.clock())
  end	
  os.sleep(0.1)
end

D
Dimonchik, 2018-11-10
@dimonchik2013

same way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question