local S=game:GetService("\082\117\110\083\101\114\118\105\099\101")local W=S.Stepped local n=0 local function j(S)S=typeof(S)=="\110\117\109\098\101\114"and S or 0 local n=0 repeat local j,Z=W:Wait()n+=Z until n>=S return n end local Z=require(game.ReplicatedStorage.BetterWait)j(1)W:Connect(function()n+=1 end);(coroutine.wrap(function()local S=os.clock()print(j(5))print("\083\116\097\110\100\097\114\100\087\097\105\116 \097\116 \102\114\097\109\101 ",n)print("\083\116\097\110\100\097\114\100\087\097\105\116 \097\099\116\117\097\108\108\121 \116\111\111\107 ",os.clock()-S)end))()local v=os.clock()print(Z(5))print("\066\101\116\116\101\114\087\097\105\116 \097\116 \102\114\097\109\101 ",n)print("\066\101\116\116\101\114\087\097\105\116 \097\099\116\117\097\108\108\121 \116\111\111\107 ",os.clock()-v)
local RunService = game:GetService("RunService")
local Stepped = RunService.Stepped
local frameCount = 0

local function StandardWait(n)
	n = typeof(n) == 'number' and n or 0

	local spent = 0
	repeat
		local _, deltaTime = Stepped:Wait()
		spent += deltaTime
	until spent >= n
	return spent
end

local BetterWait = require(game.ReplicatedStorage.BetterWait)

StandardWait(1)

Stepped:Connect(function()
	frameCount += 1

	--\\ Remember? Connections are fired from last to first,
	-- So we need this to update before anything else!
end)


coroutine.wrap(function()
	local timeTook = os.clock()
	print(StandardWait(5))
	print("StandardWait at frame ", frameCount)
	print("StandardWait actually took ", os.clock() - timeTook)
end)()

local timeTook = os.clock()
print(BetterWait(5))
print("BetterWait at frame ", frameCount)
print("BetterWait actually took ", os.clock() - timeTook)
