InvokeRepeating, but with frames

Hello folks!

The most simple way to describe my problem: i need a function like
public void InvokeRepeating(string methodName, float time, float repeatRate);
but it should repeat every x frames instead of every x seconds.

public class Timer : MonoBehaviour
{
    int frame_length;
    int frame_speed;
    public delegate void TestDelegate();

    public Timer(TestDelegate function, int length, int speed)
    {
        frame_length = length;
        frame_speed = speed;
        //?? = function?
    }
   
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        if (frame_length > 0)
        {
            frame_speed--;
            if (frame_speed == 0)
            {
                frame_length--;
                frame_speed = 4;
                //function();?
            }
        }
    }
}

i tried something like this, but i’m fairly new to unity and have no clue.
Thanks in advance

That’s easy. In standard coroutine:

for(int i = 0; i < framesToSkip; i++) yield return null;

thanks for the reply. However, i don’t know what to do with this piece of code, where to put it etc.

Inside standard unity coroutine Unity - Manual: Coroutines

Alright thanks! is this precise?

yield return null in coroutine waits one frame