Conveniently Managing Coroutine Using Task
Overview
How to Use
Features
Description
1. Pausing the Thread
local elapsedTime = task.wait(1)
print(`task.wait(1) real waited time(sec): {elapsedTime}`)2. Creating and Running a Coroutine Immediately
local function TaskSpawn(a, b, c, tbl)
print("task.spawn executed", a, b, c)
for k, v in pairs(tbl) do
print(`["{k}"]: {v} ({typeof(v)})`)
end
end
task.spawn(TaskSpawn, "arg1", 123, true, {x = 78, y = "90"})3. Running the Coroutine Function after a Set Duration
4. Scheduling a New Coroutine Function to Run After the Current Coroutine Ends
5. Canceling a Scheduled Coroutine Function
Last updated