-
public class LastN_HitCounterFuji * Reve Systems * 2022 * Sometimes we wanna track the count of how many times a event has been happened in last n millis. This class is here to solve this exact problem. At first we have to create a object of this class passing the time values in millis which is the last duration for which we want the count
-
-
Constructor Summary
Constructors Constructor Description LastN_HitCounter(int millis)initializing the timestamps linkedlist
-
Method Summary
Modifier and Type Method Description voidhit()this method should be called everytime an event occurs which we wanna track intgetLastN_Count()firstly we have to delete older values and then return the linkedlist size static voidmain(Array<String> args)-
-
Method Detail
-
hit
void hit()
this method should be called everytime an event occurs which we wanna track
-
getLastN_Count
int getLastN_Count()
firstly we have to delete older values and then return the linkedlist size
-
-
-
-