Logistical Transporter path caching.

I managed to take the average path calculation time down from 4-8 milliseconds to 100-200 microseconds. All in a day's work!
This commit is contained in:
Aidan C. Brady committed 2014-08-21 20:46:51 -04:00
1 parent 80021dd4c7
commit f87cc4a1e3
7 files changed
+117 -45

No files matched your search

@@ -0,0 +1,26 @@
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;
}
}