TPS

  • Getting the ticks per seconds wouldn't be very helpful in RW unfortunately, because the RW server is a multi-threaded application. There is a main thread which performs some basic tasks, like saving the world, updating furnaces and growing plants, determines weather changes etc. The PluginAPI UpdateEvent is also invoked from the main thread atm. It has a getTpf() method to get the current time per frame (this is basically what you're looking for).


    But things like world generation, player/npc sync, npc handling, networking etc run in separate threads, so even if the main thread is busy doing something specific, it wouldn't be very noticable. Only if the main thread is constantly extremely busy (tpf always > 5-10 seconds), something could be wrong (plugin timers and calls like "enqueue()" or "executeDelayed()" also run on the main thread, so they would have an impact on that) :thinking:

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!