APISonar


io.dropwizard.metrics.Timer.time

> io > dropwizard > metrics > Timer > time
io APIs dropwizard APIs metrics APIs Timer APIs time APIs

Example 1
private final Timer timer = new Timer(reservoir, clock);

    public void timesCallableInstances() throws Exception {
        final String value = timer.time(() -> "one");

        assertThat(timer.getCount())
                .isEqualTo(1);

        assertThat(value)
                .isEqualTo("one");

        verify(reservoir).update(50000000);
    }