How to adjust my function binded based on render step to ensure that it always finishes in a specific time frame?

I have a function below that is binded to render step, that is BindToRenderStep() , and I want to know if the function can be adjusted to ensure that the camera animation is always completed in a specified time frame. Here is my code:

local function OnRenderedFrame(DeltaTime)
				
				Camera.CFrame = PlayerMoverModel.PrimaryPart.CFrame:ToWorldSpace(
								CFrame.Angles(0,math.rad(CurrentRot),0))*CFrame.new(0,0,CurrentDist)
				
				CurrentRot = CurrentRot-ROT_PER_FRAME
				CurrentDist = CurrentDist + (DIST_PER_FRAME)
				
				if CurrentRot <= TargetRot and CurrentDist >= TargetDist then
					
					RS:UnbindFromRenderStep(BindingName)
					wait(LOOKTIME)
					
					if FlagGUI then
						
						self:InterfaceGUI()
						
					end
					
				end
				
			end
			
			RS:BindToRenderStep(BindingName,Enum.RenderPriority.Last.Value,OnRende

Something like

local startTime = tick()
local timeFrameLength = 10  --10 seconds

local function OnRenderedFrame(DeltaTime)
 if tick() - startTime > timeFrameLength then
  --do code and possibly Unbind function from RenderStep
 end
end