1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Is there a way to use scheduleRepeatingTask without making lag?

Discussion in 'Development' started by Levi, Jun 10, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Is there a way to use scheduleRepeatingTask without making much lag?
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Don't run laggy things inside the task. That's the best we can answer from your question. Provide more information so that people can answer your question more specifically.
     
    Last edited: Jun 10, 2018
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    I run a repeating task that clears all entities in all levels every 5 minutes.
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Is that laggy? If it is, what about spreading the entity clearing to a few more ticks?

    In addition, are you referring to server lag or client lag? If it is the client lag, you should run the entity clearer more frequently.
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Yes in timings, it's almost in the very top and colored red
     
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Run it more frequently so that the load can be spread out.
     
  7. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    so instead of 5minutes, 2 minutes?
     
  8. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    or just dont use it!!!!!!!!!!!!!!!!!!!!!!!!!!/s
    maybe more frequent but less clearings, like only clear 40% of the items by item age
    or to limit the time of your forloop for each runs
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.