Skip to content

Instantly share code, notes, and snippets.

@spullara spullara/Pauses.java
Created May 22, 2018

Embed
What would you like to do?
Timer timer = mr.timer("jvm.pausetime");
new Thread(() -> {
while (true) {
long start = System.nanoTime();
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// ignore
}
long diff = System.nanoTime() - start;
timer.update(diff - 10_000_000, TimeUnit.NANOSECONDS);
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.