package de.ivu.elect.jee.performance;

import java.util.concurrent.atomic.AtomicLong;

public class ViewAccessDynamic {

  private final AtomicLong COUNTER = new AtomicLong(0L);

  private final AtomicLong TIME_TOTAL = new AtomicLong(0L);

  public void addDuration(long duration) {
    TIME_TOTAL.addAndGet(duration);
    COUNTER.incrementAndGet();
  }

  public long getCounter(){
    return COUNTER.get();
  }

  public long getTimeTotal(){
    return TIME_TOTAL.get();
  }

  public void addCounterAndDuration(long counter, long duration) {
    TIME_TOTAL.addAndGet(duration);
    COUNTER.addAndGet(counter);

  }
}
