Framerate indipendent operation in a method

Is there a way to perform operations within a method at a constant rate that does not depend on the framerate?

This question comes up again and again and again, and it’s almost impossible to answer in a vacuum, since what you mean by “constant rate” is ambiguous.

If you find yourself relying on precise timing, that’s generally a “bad code smell” and a strong sign that you may wish to reconsider your design so that it is tolerant and aware of varying timing realities.

Here’s some more reading:

Here is an abbreviated and better-annotated version of the above:

Two good discussions on Update() vs FixedUpdate() timing:

Sounds like you might be looking for Time.deltatime
Which is what everyone uses to make calculations seem frame rate independent
So your character moves at the same speed whether they are running at 30 fps or 120 fps, for example.
It’s the time passed between this frame and the previous frame

What is it that you’re trying do accomplish?

Specifically, if it’s physics-related related then FixedUpdate is your best option. Contrary to popular belief though you should not used FixedUpdate for anything other than physics due to the fact that it can actually tick multiple times in a single frame (as a way to keep the simulation properly up to date with realtime).

For other logic-related things you can potentially use Time.deltatime as suggested though with variable framerates this can cause issues as well. If you really need something precise then implementing your own ‘fixed’ update is probably the best option. You can do this by running some logic every frame update and use a timer to see if it’s time for th next tick. Even then you still run the risk of slight variance based on fluctuations in timers as well as the framerate the game is running.