Scheduling task after given amount of seconds

Discussion in 'Plugin Development' started by paalbra, Apr 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    paalbra

    Hi

    I want something to happen 10 seconds after an event. Since you schedule events after given amount of server ticks my question is: Can you trust a given amount of server ticks to be the same as a second?

    As far as i've understood there is 20 server ticks in a second. Will 10*20 ticks be exactly ten seconds(Or at least so close that a human can't notice some miliseconds plus/minus)?
     
  2. Offline

    Tog

    Unless the server is lagging it should be 20 ticks per second, with lag there'll be less ticks per second.
     
  3. Offline

    paalbra

    So one should just expect the server not to be lagging or is there a better way to schedule events after a given amount of seconds?
     
  4. Offline

    Smex

    Use threads or the bukkit scheduler.
    If you are going to stop the main server thread for 10 seconds, then the
    whole server freezes for 10 seconds/could also crash.
     
Thread Status:
Not open for further replies.

Share This Page