[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");
// Start LaunchServer
Instant start = Instant.now();
long startTime = System.currentTimeMillis();
try {
LaunchServer launchserver = new LaunchServer(IOHelper.WORKING_DIR, args);
if(args.length == 0) launchserver.run();
@ -287,8 +287,8 @@ public static void main(String... args) throws Throwable {
LogHelper.error(exc);
return;
}
Instant end = Instant.now();
LogHelper.debug("LaunchServer started in %dms", Duration.between(start, end).toMillis());
long endTime = System.currentTimeMillis();
LogHelper.debug("LaunchServer started in %dms", endTime - startTime);
}
// Constant paths

View file

@ -30,15 +30,15 @@ public static void main(String... args) throws Throwable {
// Start Launcher
initGson();
LogHelper.setStacktraceEnabled(true);
Instant start = Instant.now();
long startTime = System.currentTimeMillis();
try {
new LauncherEngine().start(args);
} catch (Exception e) {
LogHelper.error(e);
return;
}
Instant end = Instant.now();
LogHelper.debug("Launcher started in %dms", Duration.between(start, end).toMillis());
long endTime = System.currentTimeMillis();
LogHelper.debug("Launcher started in %dms", endTime - startTime);
}
public static void initGson() {

View file

@ -38,7 +38,7 @@ public void eval(String[] args, boolean bell) {
return;
// Measure start time and invoke command
Instant startTime = Instant.now();
long startTime = System.currentTimeMillis();
try {
lookup(args[0]).invoke(Arrays.copyOfRange(args, 1, args.length));
} catch (Exception e) {
@ -46,8 +46,8 @@ public void eval(String[] args, boolean bell) {
}
// Bell if invocation took > 1s
Instant endTime = Instant.now();
if (bell && Duration.between(startTime, endTime).getSeconds() >= 5)
long endTime = System.currentTimeMillis();
if (bell && endTime - startTime >= 5000)
try {
bell();
} catch (IOException e) {