public boolean incrementReceived(){
  Long diff=System.currentTimeMillis() - startTime;
  if (diff >= 1000) {
    packetsPerSecond=intervalPackets;
    startTime=System.currentTimeMillis();
    intervalPackets=1;
    return true;
  }
 else {
    intervalPackets++;
  }
  this.receivedPackets++;
  return false;
}

public boolean incrementReceived ( ) { Long diff = System . currentTimeMillis ( ) - startTime ; if ( diff >= 1000 ) { packetsPerSecond = intervalPackets ; startTime = System . currentTimeMillis ( ) ; intervalPackets = 1 ; return true ; } else { intervalPackets ++ ; } this . receivedPackets ++ ; return false ; }
used for incrementing the number of packets received from the client
