Make use of Instant / Duration classes where possible for time handling

This commit is contained in:
Luck committed 2019-12-24 23:10:26 +00:00
1 parent 6e64f80c81
commit 96c53091d0
38 files changed
+311 -340

No files matched your search

@@ -57,6 +57,7 @@ import org.spongepowered.api.scheduler.SynchronousExecutor;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.time.Instant;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
@@ -102,7 +103,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
/**
* The time when the plugin was enabled
*/
private long startTime;
private Instant startTime;
// load/enable latches
private final CountDownLatch loadLatch = new CountDownLatch(1);
@@ -162,7 +163,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
@Listener(order = Order.FIRST)
public void onEnable(GamePreInitializationEvent event) {
this.startTime = System.currentTimeMillis();
this.startTime = Instant.now();
try {
this.plugin.load();
} finally {
@@ -218,7 +219,7 @@ public class LPSpongeBootstrap implements LuckPermsBootstrap {
}
@Override
public long getStartupTime() {
public Instant getStartupTime() {
return this.startTime;
}