Invoke a method for exactly 2 seconds to move a rigidbody

Hello, I’m stuck on this issue and could use some help if anyone knows what’s wrong with my code. The code pasted below is meant to move my icon gameObjects rigidbody at a constant speed when bool rising is true. public void moveUp() is called from another script and its purpose is to move the rigidbody for exactly 2 seconds. I think that the problem is that the 2 seconds are based on framerate which changes, thus making my rigidbody end up in the wrong spot. However, I can’t figure out how to invoke the makeFalse() method with deltaTime. Could somebody tell me how to invoke the moveUp() method for exactly 2 seconds in a way that works with this code? Thanks!

public class iconRigidbody : MonoBehaviour
{
public Rigidbody rb;
bool rising;
public float Xspeed;
public float Yspeed;
public float Zspeed;

public void FixedUpdate()
{
    if (rising == true)
    {
        rb.velocity = new Vector3(Xspeed, Yspeed, Zspeed);

    }
    if (rising == false)
    {
        rb.velocity = new Vector3(-0, 0, 0);

    }
}
public void moveUp()
{
    rising = true;
    Invoke("makeFalse", 2);

}
public void makeFalse()
{
    rising = false;
}

}

have a variable and increase it every update with time.delta time. If the variable is greater than 2, you stop ur function