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