Skip to content

Instantly share code, notes, and snippets.

@spullara
Created May 22, 2018 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spullara/03608f950d8b930e5c1c412e4acd9e0d to your computer and use it in GitHub Desktop.
Save spullara/03608f950d8b930e5c1c412e4acd9e0d to your computer and use it in GitHub Desktop.
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