setTimeout

Declaration

int setTimeout(Action callback,int millSecond);

Description

Provide the ability to delay calling the specified callback function and use the return value to cancel the added delay call.

local iDelayExecute = setTimeout(function()
  print("This log will be printed in 3 seconds");
end,3000);

-- you can cancle it use clearTimeout
clearTimeout(iDelayExecute);