Skip to content

Commit

Permalink
fix log execution time
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljaz committed Jan 2, 2024
1 parent 2a1cb5f commit 8a5971b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void onEnable() {
@Override
public void onCommand(String command) {
logCommandExecutionTime(command);
Bukkit.getScheduler().runTask(BukkitShopMCPlugin.this, () -> Bukkit.dispatchCommand(getServer().getConsoleSender(), command));
}

@Override
Expand Down Expand Up @@ -81,7 +80,7 @@ public void onDisable() {
private void logCommandExecutionTime(String command) {
long startTime = System.nanoTime();

// Execute the command here
Bukkit.getScheduler().runTask(this, () -> Bukkit.dispatchCommand(getServer().getConsoleSender(), command));

long endTime = System.nanoTime();
long executionTime = endTime - startTime;
Expand Down

0 comments on commit 8a5971b

Please sign in to comment.