[SOLVED] Check for Tick

Is there anyway to check if a server is still ticking? There’s a way to check how many ticks a server has been online, but I couldn’t find one that checks if the server itself is still ticking. Any help would be appreciated greatly! Thanks! :smiley:

  • Get the system time.
  • Schedule a Runnable for every tick.
  • After 20 ticks, stop.
  • Get the system time.
  • Compare 1 and 4, to get TPS.
1 Like

Do you mean just by using Java’s Time & System class? Or by using System class and Sponge Scheduler

Not sure about the Time class. Just System.

System.currentTimeMillis();

Yeah I know about
System.currentTimeMillis();

However, would I go about setting a task after 20 ticks, using the Sponge Scheduler interface?
runRepeatingTask(Object plugin, Runnable task, long interval)

Unless I’m mistaken, Sponge’s Scheduler uses Ticks as a time reference, not milliseconds.

So the interval would just be 1.

1 Like

Alright thanks for your help!