Logo with title ".Blog"

Cancelable delays

Published on

Protip: task.delay returns the delayed thread, making cancelable delays trivial.

local thread = task.delay(10, print, "Hi!")
task.wait(5)
task.cancel(thread)