Lag from wait or every x seconds

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ZeaL_BG

Member
Mar 11, 2017
4
0
0
Skript Version: 2.2-dev25
Skript Author:Njol I guess
Minecraft Version: Paper 1.12R0.1

---

I don't have a problem with the code. I have a problem with the lag that 1 of my skcipts probably causes. I have the following https://prnt.sc/hlnm7l in my timing and as I can understand it has something to do with timed event. I want to ask few things about it so I can find where the problem is. So 1200 is in ticks so it has to be 60 seconds, right? And the second question I want to ask is if this is caused by an "wait" effect or by "every x seconds" event?

I hope that this thread is not against the rules.
 
while loops are supposedly better than periodicals but if youre doing alot of stuff theres no guarantee it wont still lag
code_language.skript:
on script load:
    while true is true:
        #do stuff
        wait 1 second
instead of
code_language.skript:
every 1 second:
    #do stuff
 
Yeah I know it, I just want to know if the problem is from the "every 1 second" and how much time is the 1200 in the timing
 
It says EvtPeriodical in your timing thing so yeah its the 'every whatever'. I would think the 1200 is ticks like you said.
 
Okay, will change it everywhere I used it. Thanks a lot! Gonna post an update tomorrow how its going
[doublepost=1513025205,1512939828][/doublepost]I think its better today. http://prntscr.com/hm640v its still alot due to the things that happens in this event. Thanks for your help again!
 
Status
Not open for further replies.