How to make a stamina bar

Woud be easier to if when you pressed the button you got delta time, multiplied it by your decay rate then minus it from stamina. That way you arent calling the branch everysingle second checking if its true yet.