Timer last 5 second counter

Hello i have problem counting delta timer last 5 second counts.
i have image for explanation
alt text

Word explanation
Timer have run 23 seconds and total click in 23 seconds is 72.
Last 5 seconds is 20 clicks.
i want make so that lable show that last 5 second counts, how i can do it ?.
But i dont have idea how to make it so.

Something like the below will work to keep track of the last 5 seconds of ticks.

However, it will only update once a second, but it will be efficient:

private int lastWholeSecond;
private List<int> _ticksDuringSecond = new List<int>(6);

void Update()
    int wholeSecond = (int)Time.time;

    if( wholeSecond > lastWholeSecond )
        lastWholeSecond = wholeSecond;

        // Get rid of the oldest second
        _ticksDuringSecond .RemoveAt(5);

        // Add a new second at the beginning that starts at 0
        _ticksDuringSecond .Insert(0,0);

    // Add a tick to the current second
    _ticksDuringSecond [0]++;

    // Count the seconds from 1-5 
    // (Skip the current second because it is not done)
    int sum = 0;
    for(int i = 1; i <= 5; i++)
        sum += _ticksDuringSecond *;*

TickCountLabel.text = “” + sum;