Does RunService.RenderStepped always run every 1/60 of a second?

I am making an egg hatching system, and I do this

        local speed = 10 
		hatchOneConnection = RunService.RenderStepped:Connect(function()

			local cf = CFrame.Angles(0,0,math.sin(speed)/2)
			eggModel:SetCFrame(cf)
			if speed < 60 then
				speed += 0.01 * speed
			end
		end)

I want it to take up 3 seconds(which i do a wait(3) later in the script), but this is the only way I saw how to do it.

Why don’t you just set a loop to repeat every 3 seconds?

Also, not completely sure but I believe it runs every frame the player is getting

I have this run for 3 seconds, then destroy the connection under. Is there a way to coroutine this? I dont know much about coroutines lol but I want this to run beside the stuff beneath it

There are while and repeat/until loops, that run at whatever speed you tell them to wait.

I would not use any runservice for this… way too fast.

Not sure how to use coroutines sorry lol
But answering the title:
It runs every frame the player is getting, If the game is running at 40 FPS, then RenderStepped will fire 40 times per second and the step argument will be roughly 1/40th of a second.
Different for every player and players with FPS unlockers will likely be running it way more
https://developer.roblox.com/en-us/api-reference/event/RunService/RenderStepped

yeah i know that, but I need it to run alongside what is beneath it which is why i did renderstepped, is there a way to use a while loop coroutined? I dont know much about coroutines.

RenderStepped fires at every frame render on your device.
So if you’re playing on 120 FPS, your speed will go up twice as fast as if you were playing on 60 FPS.
Look into DeltaTime, your RenderStepped passes it as an argument through parameters

You could wrap it in task.spawn

coroutine.wrap(function here)(parameters to call it)

That will allow you to keep executing other commands.

how do i end a coroutine.wrap?

in your repeat/until loop, make the “until” your break.

what do you mean? do i have to do like coroutine.destroy or something? here is the full code btw

        local speed = 10 
		hatchOneConnection = RunService.RenderStepped:Connect(function()

			local cf = CFrame.Angles(0,0,math.sin(speed)/2)
			eggModel:SetCFrame(cf)
			if speed < 60 then
				speed += 0.01 * speed
			end
		end)
    if not bool then wait(3) else wait(1.2) end
	TweenService:Create(script.Parent.Parent.EggDisplay:FindFirstChildOfClass("ViewportFrame"),TweenInfo.new(0.5),{ImageTransparency = 1}):Play()
	wait(0.5)
	hatchOneConnection:Disconnect()

for example:

local stopcode = false

coroutine.wrap( function ()
repeat
   print("Waiting")
task.wait(1)
until stopcode
end)()
task.wait(10)
stopcode = true

something like that. I just winged this. Havent tested. lol (needed a wait!)

    coroutine.wrap(function()
		repeat
			local cf = CFrame.Angles(0,0,math.sin(speed)/2)
			eggModel:SetCFrame(cf)
			if speed < 60 then
				speed += speedInc * speed
			end
			task.wait()
		until doneEgg
	end)

Why doesnt this work? I dont think coroutines print errors

Egg is a model? I recommend :PivotTo to set the CFrame of the model.

Also, I would not declare the variable inside the loop.

But most importantly, coroutine.wrap does not call the function without an additional () at the end.

		until doneEgg
	end)()

That’s what calls the function.