How to detect how many clicks per second were given

That simple, hahaha, but i can’t figure it out!, Like if i tap two times in a second the int goes to 2 and if in the next second i do it 1 time the int goes do 1, any help?

Keep in mind, i’m not writing actual code… But the concept is essentially the same.

private float _timer = 0;
private int mouseclicks = 0;
void Update()
_timer += time.DeltaTime;

if (_timer < 1)
if (Input.GetMouseInput(0)) mouseclicks++;
} else {
Debug.Log("I had "+ mouseclicks +" in that last second.");
_timer = 0f;