dokato Posted December 13, 2017 Posted December 13, 2017 Is the onMessage() executed all the time? Because i noticed some delay before it gets executed. It kinda screws up the flow.
TheMcPker Posted December 13, 2017 Posted December 13, 2017 no its not executed "All the time" it has a small delay in it i assume to not kill your Cpu usage
Explv Posted December 13, 2017 Posted December 13, 2017 29 minutes ago, dokato said: Is the onMessage() executed all the time? Because i noticed some delay before it gets executed. It kinda screws up the flow. I don't believe it runs on a separate thread, so while your script is doing other things, including sleeping, it won't be executed.
IDontEB Posted December 13, 2017 Posted December 13, 2017 I think it gets executed at end of 1 onLoop() iteration. I'm not sure though.
Team Cape Posted December 13, 2017 Posted December 13, 2017 If you wanted to run it on a separate thread, it probably wouldn't be hard, to be honest. I'd just be very cautious of CPU usage because chances are that there's a reason why the developers would have decided against it.
TheMcPker Posted December 20, 2017 Posted December 20, 2017 well you could always check the last message sent every 50-100ms orso this shoudn't really cause a big increase in cpu usage tbh