local t=.016666666666667 local function K(K)K=tonumber(K)or t local s=os.clock()local o=coroutine.running()threads[n_threads+1]=o threads[n_threads+2]=s+K n_threads+=2 local a=coroutine.yield()return a-s,a end return K

local default_wait = 1/60
local function FastWait(wait_time)
	-- Verifies [wait_time]
	wait_time = tonumber(wait_time) or (default_wait)

	-- Mark [start] time
	local start = os.clock()

	-- Get running [thread]
	local thread = coroutine.running()

	-- Insert it in [threads] table
	threads[n_threads + 1] = thread
	threads[n_threads + 2] = (start + wait_time)

	n_threads += 2

	-- Wait until the coroutine resumes (the yielding finishes)
	local current_time = coroutine.yield()

	-- Return: (time_it_waited, current_time)
	return (current_time - start), current_time
end

return FastWait
