Task.expired
The Task.expired property returns true if the Task.timeout is reached, or false otherwise.
Example
local t = sys.Task(function()
print("task: started, will sleep 5000ms")
sleep(5000) -- long work
print("task: finished (this may not run if timed out)")
end)
-- set a 1 second timeout (milliseconds)
t.timeout = 1000
-- start and wait
t()
await nt
print("task.status:", t.status) -- "terminated" expected
print("task.expired:", t.expired) -- true if terminated due to timeout