public long getTotalEvents(){
        int total = 0;
        for(int i=0; i < GRANULARITY; i++){
            total += counter.get(i);
        }
        return total;
    }
Date 03/03/2015
@author tusroy

Develop a software to count number of events in last 5 mins. You have to support two apis
1) addEvent() -> It means increment event by 1
2) getTotalEvents() -> Return total number of events in last 5 mins

Program should support millions of events every minute and should also provide multi-threading support

This class might not have 100% accuracy as far as events in last 5 mins are concerned. 
Since we are using circular queue last second information may not be very accurate.

Solution:
Keep atomiclong of 300 in array. PositionUpdater updates position every second.
@Threadsafe
src/com/interview/multithreaded/RealTimeCounter.java