[FIX] Немного правок из репозитория Сашка

This commit is contained in:
Gravit 2019-03-13 15:52:50 +07:00
parent 5ad5795a62
commit d2963e8b40
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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() {

View file

@ -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) {