--[=[
	@param interval number
	@param callback () -> nil
	@param startNow boolean?
	@param updateSignal RBXScriptSignal? | Signal?
	@param timeFunc () -> number
	@return RBXScriptConnection

	Creates a simplified timer which just fires off a callback function at the given interval.
]=]

function Timer.Simple(interval: number, callback: CallbackFunc, startNow: boolean?, updateSignal: RBXScriptSignal?, timeFunc: TimeFunc?)
	local update = updateSignal or RunService.Heartbeat
	local t = timeFunc or time
	local nextTick = t() + interval
	if startNow then
		task.defer(callback)
	end
	return update:Connect(function()
		local now = t()
		if now >= nextTick then
			nextTick = now + interval
			task.defer(callback)
		end
	end)
end

