Timings In Scheduler

Discussion in 'Plugin Development' started by PandazNWafflez, May 23, 2012.

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

    PandazNWafflez

    I presume these are measured in ticks, 20 ticks / second on average, but am I wrong?
     
  2. Offline

    Njol

    Yes, this is correct.
     
  3. Offline

    LordJason

    That can't be right. According to my timings.txt the fastest plugin I have takes on avg 4.4~ Minutes for the EntityDamage event. (Avg:5305)
    Of course then it says, Total time 1071635 (0s)
     
  4. Offline

    JDigital1337

    It is 20 per second:

    ticks = 20 * second
     
  5. Offline

    LordJason

    Yes so, 5305/20= 265.25 seconds on avg. That's why I'm saying it has to be wrong. If an event took 5k ticks, every player on the server would be kicked for timing out each time that event fires. And that is the fastest one listed in the file.
    Do you guys have different numbers? Am I doing/calculating something improperly?

    Figured it out, Looking at the source I noticed
    fileTimings.println(" Total time " + totalTime + " (" + totalTime / 1000000000 + "s)");
    So looks like maybe the numbers in the txt file are actually long's missing the decimal....
    The actual additive line is,
    totalTime += System.nanoTime() - start;

    And totalTime is in fact a long. So yep, take the timings and divide by 1,000,000,000.

    TLDR: These numbers aren't ticks. It's the time in nanoseconds.
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    timings are in nanoseconds iirc
     
Thread Status:
Not open for further replies.

Share This Page