mirror of
https://github.com/lune-org/mlua-luau-scheduler.git
synced 2025-04-10 21:40:55 +01:00
17 lines
361 B
Text
17 lines
361 B
Text
for i = 1, 5 do
|
|
print("iteration " .. tostring(i) .. " of 5")
|
|
|
|
local counter = 0
|
|
for j = 1, 10_000 do
|
|
spawn(function()
|
|
wait(0.1 * math.random())
|
|
counter += 1
|
|
if counter == 10_000 then
|
|
print("completed iteration " .. tostring(i) .. " of 5")
|
|
end
|
|
end)
|
|
end
|
|
|
|
-- FIXME: This resumes instantly with mlua "async" feature
|
|
coroutine.yield()
|
|
end
|