Doing lots of "code optimization" these days and I'm wondering what the most CPU friendly way of waiting one bloc is in a script.
If I understand correctly, setting a flag based on polling an input in the main process block of a script, and then executing code using a condition will allow me to span blocs. Compared to the event-driven fast callback procedure, continuously polling and looping in the body seems processing intensive.
Is there a way that I can trigger a script's execution using the callback but have it wait one bloc to update an output? Can I simply move the flag-&-conditional-evaluation into a procedure called from the fast callback?
Wht is the most efficient way to "wait" one bloc using a script?
what i do is on callback procedure when according input changes i set a counting variable value to 0. then on process only if that value is positive it counts to N blocs and reverts to -1 when max is reached, until a new event is trigged and so on
Thanks 23fx23. Doesn't this mean that the processing block is continuously running to check your counting var?
Regards,
Scott
Scott
yes could be reduce to bool but im not sure something lower cpu could be found, since a process procedure will necessarely need something to be trigged. Unless i missed something time relative blocs manipulation cannot rely only on callbacks procedures
Who is online
Users browsing this forum: No registered users and 48 guests
