mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
Add tick times API
This commit is contained in:
parent
0ee773e88b
commit
c0e42aed8a
@ -2218,6 +2218,25 @@ public final class Bukkit {
|
|||||||
public static double[] getTPS() {
|
public static double[] getTPS() {
|
||||||
return server.getTPS();
|
return server.getTPS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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() {
|
||||||
|
return server.getTickTimes();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the average tick time (in millis)
|
||||||
|
*
|
||||||
|
* @return Average tick time (in millis)
|
||||||
|
*/
|
||||||
|
public static double getAverageTickTime() {
|
||||||
|
return server == null ? 0D : server.getAverageTickTime();
|
||||||
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1877,6 +1877,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public double[] getTPS();
|
public double[] getTPS();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a sample of the servers last 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)
|
||||||
|
*
|
||||||
|
* @return Average tick time (in millis)
|
||||||
|
*/
|
||||||
|
double getAverageTickTime();
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
|
Loading…
Reference in New Issue
Block a user