Smoothly rotate while holding

hey,
I was wondering… How would I rotate an object to the left while holding the left button and rotate it to right while holding the right button. Right now I have 2 buttons, left and right and a few event triggers…

public void OnPointerUpRight()
{
isPressedRight = true;
}

public void OnPointerDownRight()
{
    isPressedRight = false;
}

public void OnPointerDownLeft()
{
    isPressedLeft = true;
}

public void OnPointerUpLeft()
{
    isPressedLeft = false;
}

After searching for an hour I could not find a solution, how would I rotate an object while holding a button?

Thanks

Got it myself, didnt know it was that easy

 void Update()
    {
        if(GameController.Instance.isPressedLeft == true)
        {
            transform.Rotate(Vector3.forward * speed);
        }
        if (GameController.Instance.isPressedRight == true)
        {
            transform.Rotate(Vector3.back * speed);
        }
    }