CpuTimeClock extends Clock { @Override public long getTick() { return THREAD_MX_BEAN.getCurrentThreadCpuTime(); }  @Override long getTick();  }
@Test public void cpuTimeClock() { final CpuTimeClock clock = new CpuTimeClock(); assertThat((double) clock.getTime()) .isEqualTo(System.currentTimeMillis(), offset(200.0)); assertThat((double) clock.getTick()) .isEqualTo(ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime(), offset(1000000.0)); }