How to calculate key presses per second? BPS

How can I calculate the average keyboard presses per second?
something like what this site provides beatsperminuteonline

Using Time.deltaTime, which can be used in Update to give you the realworld change in time since the last update function.

You can use a variable to keep track of a player’s key presses, and then use another variable to keep track of time in the update function. When you need to know the average, simply divide the number of clicks by time. That’s how you find an average.