Code example for AtomicLong

Methods: floatValue, get

0
  public long getCount() { 
    return count.get();
  } 
   
  public float getAvg() { 
    if(count.get() == 0) {
      return 0; 
    } 
    return (float)(currentValue.floatValue() / count.floatValue());
  } 
}