make PackBenchmark startup show errors

This commit is contained in:
Julian Krings
2024-08-03 16:56:17 +02:00
parent d2ecbc5727
commit ab30710e2a
@@ -35,7 +35,6 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.time.Clock; import java.time.Clock;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collections; import java.util.Collections;
import java.util.concurrent.*;
public class IrisPackBenchmarking { public class IrisPackBenchmarking {
@@ -60,8 +59,7 @@ public class IrisPackBenchmarking {
public void runBenchmark() { public void runBenchmark() {
this.stopwatch = new PrecisionStopwatch(); this.stopwatch = new PrecisionStopwatch();
ExecutorService service = Executors.newSingleThreadExecutor(); new Thread(() -> {
service.submit(() -> {
Iris.info("Setting up benchmark environment "); Iris.info("Setting up benchmark environment ");
benchmarkInProgress = true; benchmarkInProgress = true;
File file = new File(Bukkit.getWorldContainer(), "benchmark"); File file = new File(Bukkit.getWorldContainer(), "benchmark");
@@ -76,8 +74,7 @@ public class IrisPackBenchmarking {
Iris.info("Starting Benchmark!"); Iris.info("Starting Benchmark!");
stopwatch.begin(); stopwatch.begin();
startBenchmark(); startBenchmark();
}); }, "PackBenchmarking").start();
} }
public boolean getBenchmarkInProgress() { public boolean getBenchmarkInProgress() {