mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
I managed to take the average path calculation time down from 4-8 milliseconds to 100-200 microseconds. All in a day's work!
27 lines
423 B
Java
27 lines
423 B
Java
package mekanism.common.util;
|
|
|
|
public class DebugUtils
|
|
{
|
|
private static long prevNanoTime;
|
|
|
|
public static void startTracking()
|
|
{
|
|
prevNanoTime = System.nanoTime();
|
|
}
|
|
|
|
public static long getTrackedNanos()
|
|
{
|
|
return System.nanoTime()-prevNanoTime;
|
|
}
|
|
|
|
public static long getTrackedMicros()
|
|
{
|
|
return getTrackedNanos()/1000;
|
|
}
|
|
|
|
public static long getTrackedMillis()
|
|
{
|
|
return getTrackedMicros()/1000;
|
|
}
|
|
}
|