dokato Posted December 13, 2017 Share 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. Quote Link to comment Share on other sites More sharing options...
TheMcPker Posted December 13, 2017 Share 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 Quote Link to comment Share on other sites More sharing options...
Explv Posted December 13, 2017 Share 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. Quote Link to comment Share on other sites More sharing options...
IDontEB Posted December 13, 2017 Share Posted December 13, 2017 I think it gets executed at end of 1 onLoop() iteration. I'm not sure though. Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 13, 2017 Share 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. Quote Link to comment Share on other sites More sharing options...
TheMcPker Posted December 20, 2017 Share 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 Quote Link to comment Share on other sites More sharing options...