mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user