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

How can i delay without stucking

Discussion in 'General discussion' started by AndreKim, Jul 30, 2018.

  1. AndreKim

    AndreKim Silverfish

    Messages:
    22
    GitHub:
    overtook
    Hi, I'm making plugin that sends particles every 0.01 seconds.
    but their task supports 0.05

    so i want to use usleep method so i can use my task, but when i use usleep, server stucked.
    how can i process every microtime?

    sry my bad eng.
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    i highly doubt you want to create 100 particles per second, because that's faster than the main thread runs(I think), and it will be bad for both server and client performance.
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you cant
    usleep means you will be stopping the server
    so it does what it's meant to do
    you could have multiple task running in 1 tick
     
  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.