Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function utils.timeoutFunc(func,timeout, ...)
- if timeout == nil then timeout = -1 end
- local suc = true
- local start = os.clock()
- while not func(...) do
- suc = false
- if timeout == -1 then
- break
- elseif os.clock() > start + timeout then
- break
- end
- suc = true
- end
- return suc
- end
Advertisement
Add Comment
Please, Sign In to add comment