Code example for AtomicLong

Methods: incrementAndGet

0
        addMicro(nanos / 1000);
    } 
 
    public void addMicro(long micros)
    { 
        opCount.incrementAndGet();
        totalLatency.addAndGet(micros);
        totalHistogram.add(micros);
        recentHistogram.add(micros);
    } 
 
    public long getOpCount() 
    { 
        return opCount.get();
    } 
 
    /** returns  microseconds */ 
    public long getTotalLatencyMicros() 
    { 
        return totalLatency.get();
    }