Use System.nanoTime() for timing measurements.

This commit is contained in:
akwizgran
2018-06-15 12:04:12 +01:00
parent ccee1febbc
commit 08931e64cb
23 changed files with 136 additions and 102 deletions

View File

@@ -0,0 +1,14 @@
package org.briarproject.bramble.util;
public class TimeUtils {
private static final int NANOS_PER_MILLI = 1000 * 1000;
/**
* Returns the elapsed time in milliseconds since some arbitrary
* starting time. This is only useful for measuring elapsed time.
*/
public static long now() {
return System.nanoTime() / NANOS_PER_MILLI;
}
}