public synchronized void freeze() {
        end = System.currentTimeMillis();
    }
@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());
    }