log start time
This commit is contained in:
parent
9c0eaca4ee
commit
0ceff03bdd
|
@ -21,6 +21,8 @@ import com.google.inject.Inject;
|
|||
import org.lwjgl.LWJGLException;
|
||||
import yugecin.opsudance.core.DisplayContainer;
|
||||
|
||||
import static yugecin.opsudance.kernel.Entrypoint.log;
|
||||
|
||||
public class OpsuDance {
|
||||
|
||||
private final DisplayContainer container;
|
||||
|
@ -31,6 +33,7 @@ public class OpsuDance {
|
|||
}
|
||||
|
||||
public void start() {
|
||||
log("initialized");
|
||||
try {
|
||||
container.run();
|
||||
} catch (LWJGLException e) {
|
||||
|
|
|
@ -34,6 +34,8 @@ import yugecin.opsudance.utils.GLHelper;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static yugecin.opsudance.kernel.Entrypoint.log;
|
||||
|
||||
/**
|
||||
* based on org.newdawn.slick.AppGameContainer
|
||||
*/
|
||||
|
@ -68,6 +70,7 @@ public class DisplayContainer {
|
|||
demux.init();
|
||||
demux.switchStateNow(new EmptyRedState(null, null));
|
||||
setup();
|
||||
log("ready");
|
||||
while(!(Display.isCloseRequested() && demux.onCloseRequest())) {
|
||||
// TODO: lower fps when not visible Display.isVisible
|
||||
int delta = getDelta();
|
||||
|
|
|
@ -21,8 +21,20 @@ import yugecin.opsudance.OpsuDance;
|
|||
|
||||
public class Entrypoint {
|
||||
|
||||
public static final long startTime = System.currentTimeMillis();
|
||||
public static final boolean isJarRunning = Entrypoint.class.getResource(String.format("%s.class", Entrypoint.class.getSimpleName())).toString().startsWith("jar:");
|
||||
|
||||
public static void main(String[] args) {
|
||||
log("launched");
|
||||
InstanceContainerImpl.initialize().provide(OpsuDance.class).start();
|
||||
}
|
||||
|
||||
public static long runtime() {
|
||||
return System.currentTimeMillis() - startTime;
|
||||
}
|
||||
|
||||
public static void log(String message) {
|
||||
System.out.println(String.format("[%7d] %s", runtime(), message));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user