code: public void calc(CsvReader reader)
  	{
  		if(reader == null || reader.isEmpty())
  			return;
  		
  		init();
  		
  		reader.sortRowsForIndexByType(timeMsIndex, DataType.Long);
  
  		long tsMS, startTsMS = -1;
  		int size = reader.size();
  		
  		for(int i=0; i < size;i++)
  		{
  			tsMS = reader.get(i,timeMsIndex, DataType.Long);
  
  			this.currentVal = reader.get(i,calculateColumn, DataType.Long);
  			
  			//check if this is within a second
  			if(startTsMS == -1)
  			{
  				startTsMS = tsMS;
  				
  				addInMillsec();
  			}
  			else if ((tsMS - startTsMS) <= milliseconds)
  			{
  				addInMillsec();
  			}
  			else if( (tsMS - startTsMS) > milliseconds)
  			{
  			
  				this.incrementStat();
  				startTsMS = tsMS;
  			}
  		}
  		
  		this.incrementStat();
  	}
docs: ------------------------------------------------