1.16.5 Getting server average time per tick.

Discussion in 'Spigot Plugin Development' started by Jonnyo101, Jul 9, 2020.

  1. Hello when starting a 1.16 server i noticed this information in the built in server GUI.
    [​IMG]

    I don`t know if this is useful to anyone but i recreated the code used to display that A-TPS

    Code (Java):
            long total = 0;
            long[] tickTimes = DedicatedServer.getServer().h;
            for (long i : tickTimes) total += i;
            double averageTickTime = ((double) total / (double) tickTimes.length) * 1.0E-6D;
    I believe the average is calculated over 100 Ticks.
    Note: That value give by the coded is not rounded to 3 decimal places like in the server gui.

    Outcome.
    [​IMG]
     
    • Like Like x 1
    • Informative Informative x 1