mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Fix avg tick times
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
From cf027551379cf75f6751acda9b3e8d1dc5b75dc1 Mon Sep 17 00:00:00 2001
|
||||
From 06db9bc6c7dd75c551ed8572bf924e0e6a149067 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 30 Jan 2020 00:41:08 -0600
|
||||
Subject: [PATCH] Add tick times API
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Bukkit.java | 20 ++++++++++++++++++++
|
||||
src/main/java/org/bukkit/Bukkit.java | 21 +++++++++++++++++++++
|
||||
src/main/java/org/bukkit/Server.java | 17 +++++++++++++++++
|
||||
2 files changed, 37 insertions(+)
|
||||
2 files changed, 38 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 50415189..36e48723 100644
|
||||
index 50415189c..8fbda2aee 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1620,4 +1620,24 @@ public final class Bukkit {
|
||||
@@ -1620,4 +1620,25 @@ public final class Bukkit {
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the last 100 tick times (in nanos)
|
||||
+ * @return Last 100 tick times (in nanos)
|
||||
+ * Get a sample of the servers last tick times (in nanos)
|
||||
+ *
|
||||
+ * @return A sample of the servers last tick times (in nanos)
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static long[] getTickTimes() {
|
||||
@@ -28,7 +29,7 @@ index 50415189..36e48723 100644
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the average tick time (in millis) of the last 100 ticks
|
||||
+ * Get the average tick time (in millis)
|
||||
+ *
|
||||
+ * @return Average tick time (in millis)
|
||||
+ */
|
||||
@@ -38,7 +39,7 @@ index 50415189..36e48723 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 248c32b0..c28cc59c 100644
|
||||
index 248c32b03..7d631ac27 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1413,4 +1413,21 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -48,15 +49,15 @@ index 248c32b0..c28cc59c 100644
|
||||
+
|
||||
+ // Purpur start
|
||||
+ /**
|
||||
+ * Get the last 100 tick times (in nanos)
|
||||
+ * Get a sample of the servers last tick times (in nanos)
|
||||
+ *
|
||||
+ * @return Last 100 tick times (in nanos)
|
||||
+ * @return A sample of the servers last tick times (in nanos)
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ long[] getTickTimes();
|
||||
+
|
||||
+ /**
|
||||
+ * Get the average tick time (in millis) of the last 100 ticks
|
||||
+ * Get the average tick time (in millis)
|
||||
+ *
|
||||
+ * @return Average tick time (in millis)
|
||||
+ */
|
||||
|
||||
Reference in New Issue
Block a user