Is there any function to check how long a button is pressed?

For example, let say that there is an Attack Button.

If the player make
a slight tap [ immediately release after press ], then the Player will do Light Attack

a long tap [ hold for a bit then release ], then the Player will do Heavy Attack

a hold [ Not release after a certain amount of time ], then the Player will do Charging


I understand that this can be achieve by

timer++ during Update()

and

timer = 0 when buttonUp()


What I would like to know is,

Is there any Unity Input function that detect how long the button was pressed,

instead of coding a separate timer?

I would do this when button is pressed: timer += Time.deltaTime; and when it’s not i would do this:
… //some code
timer = 0; //re-initialize

No, there are various methods, events, timers, while/loop increments, etc but no Input.HoldDownFor()