local Z=.016666666666667 local function y(y)y=tonumber(y)or Z local F=os.clock()local g=coroutine.running()threads[n_threads+1]=g threads[n_threads+2]=F+y n_threads+=2 local N=coroutine.yield()return N-F,N end return y
-- Main function that is executed when the module is used
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
