lua - Err using coroutine -


i'm not sure if misunderstood use of coroutine, here code:

talk = coroutine.create(function () print("i speaking within 60 seconds") end)  time = coroutine.create(function () if coroutine.status(talk) == running = 60, 0, -1 print(i) end sleep(1) else coroutine.resume(talk) end  end) coroutine.resume(time) 

all print speaking within 60 seconds, expecting within countdown. how fix this?

talk = coroutine.create(function () print("i speaking within 60 seconds") coroutine.resume(time) end)  time = coroutine.create(function () = 60, 0, -1 print(i) coroutine.resume(talk) end  end)  coroutine.resume(time) 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -