@Test public void freeze() { long now = System.currentTimeMillis(); Counter tt = new Counter(now, 123L, now + 1000); tt.freeze(); tt.add(123L); assertEquals("incorrect number of bytes", 123L, tt.total()); double d = tt.duration(); double t = tt.throughput(); assertEquals("incorrect duration", d, tt.duration(), 0.0001); assertEquals("incorrect throughput", t, tt.throughput(), 0.0001); assertEquals("incorrect number of bytes", 123L, tt.total()); }
public synchronized void freeze() { end = System.currentTimeMillis(); }
Counter { public synchronized void freeze() { end = System.currentTimeMillis(); } }
Counter { public synchronized void freeze() { end = System.currentTimeMillis(); } Counter();  Counter(long start, long total, long end); }
Counter { public synchronized void freeze() { end = System.currentTimeMillis(); } Counter();  Counter(long start, long total, long end); synchronized void reset(); synchronized void freeze(); synchronized void add(long count); synchronized double throughput(); synchronized long total(); synchronized double duration(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
Counter { public synchronized void freeze() { end = System.currentTimeMillis(); } Counter();  Counter(long start, long total, long end); synchronized void reset(); synchronized void freeze(); synchronized void add(long count); synchronized double throughput(); synchronized long total(); synchronized double duration(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }