mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] Немного правок из репозитория Сашка
This commit is contained in:
parent
5ad5795a62
commit
d2963e8b40
3 changed files with 9 additions and 9 deletions
|
@ -276,7 +276,7 @@ public static void main(String... args) throws Throwable {
|
||||||
LogHelper.printLicense("LaunchServer");
|
LogHelper.printLicense("LaunchServer");
|
||||||
|
|
||||||
// Start LaunchServer
|
// Start LaunchServer
|
||||||
Instant start = Instant.now();
|
long startTime = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
LaunchServer launchserver = new LaunchServer(IOHelper.WORKING_DIR, args);
|
LaunchServer launchserver = new LaunchServer(IOHelper.WORKING_DIR, args);
|
||||||
if(args.length == 0) launchserver.run();
|
if(args.length == 0) launchserver.run();
|
||||||
|
@ -287,8 +287,8 @@ public static void main(String... args) throws Throwable {
|
||||||
LogHelper.error(exc);
|
LogHelper.error(exc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Instant end = Instant.now();
|
long endTime = System.currentTimeMillis();
|
||||||
LogHelper.debug("LaunchServer started in %dms", Duration.between(start, end).toMillis());
|
LogHelper.debug("LaunchServer started in %dms", endTime - startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constant paths
|
// Constant paths
|
||||||
|
|
|
@ -30,15 +30,15 @@ public static void main(String... args) throws Throwable {
|
||||||
// Start Launcher
|
// Start Launcher
|
||||||
initGson();
|
initGson();
|
||||||
LogHelper.setStacktraceEnabled(true);
|
LogHelper.setStacktraceEnabled(true);
|
||||||
Instant start = Instant.now();
|
long startTime = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
new LauncherEngine().start(args);
|
new LauncherEngine().start(args);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogHelper.error(e);
|
LogHelper.error(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Instant end = Instant.now();
|
long endTime = System.currentTimeMillis();
|
||||||
LogHelper.debug("Launcher started in %dms", Duration.between(start, end).toMillis());
|
LogHelper.debug("Launcher started in %dms", endTime - startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initGson() {
|
public static void initGson() {
|
||||||
|
|
|
@ -38,7 +38,7 @@ public void eval(String[] args, boolean bell) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Measure start time and invoke command
|
// Measure start time and invoke command
|
||||||
Instant startTime = Instant.now();
|
long startTime = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
lookup(args[0]).invoke(Arrays.copyOfRange(args, 1, args.length));
|
lookup(args[0]).invoke(Arrays.copyOfRange(args, 1, args.length));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -46,8 +46,8 @@ public void eval(String[] args, boolean bell) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bell if invocation took > 1s
|
// Bell if invocation took > 1s
|
||||||
Instant endTime = Instant.now();
|
long endTime = System.currentTimeMillis();
|
||||||
if (bell && Duration.between(startTime, endTime).getSeconds() >= 5)
|
if (bell && endTime - startTime >= 5000)
|
||||||
try {
|
try {
|
||||||
bell();
|
bell();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in a new issue