local a={}a.ClassName="\068\101\098\111\117\110\099\101\084\105\109\101\114"a.__index=a function a.new(L)local I=setmetatable({},a)I._length=L or error("\078\111 \108\101\110\103\116\104")return I end function a.SetLength(L,a)L._length=a or error("\078\111 \108\101\110\103\116\104")end function a.Restart(a)a._startTime=tick()end function a.IsRunning(a)return a._startTime~=nil end function a.IsDone(a)if not a:IsRunning()then return true end return tick()-a._startTime>=a._length end return a
--- DebounceTimer
-- @classmod DebounceTimer

local DebounceTimer = {}
DebounceTimer.ClassName = "DebounceTimer"
DebounceTimer.__index = DebounceTimer

function DebounceTimer.new(length)
	local self = setmetatable({}, DebounceTimer)

	self._length = length or error("No length")

	return self
end

function DebounceTimer:SetLength(length)
	self._length = length or error("No length")
end

function DebounceTimer:Restart()
	self._startTime = tick()
end

function DebounceTimer:IsRunning()
	return self._startTime ~= nil
end

function DebounceTimer:IsDone()
	if not self:IsRunning() then
		return true
	end

	return (tick() - self._startTime) >= self._length
end

return DebounceTimer