R Rafal Ciesielski Member Licensed User Longtime User Feb 13, 2014 #1 Hi , In my app I need to wait 40 microseconds to read information from Raspberry. How can I do it ?
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2014 #2 Usually the best way to manage network connections is with AsyncStreams. An event will be raised when the data is available. You can use a timer with an interval of 40ms or you can create a "busy loop: B4X: Sub Wait(ms As Int) Dim n As Long = DateTime.Now + ms Do While DateTime.Now < n Loop End Sub Upvote 0
Usually the best way to manage network connections is with AsyncStreams. An event will be raised when the data is available. You can use a timer with an interval of 40ms or you can create a "busy loop: B4X: Sub Wait(ms As Int) Dim n As Long = DateTime.Now + ms Do While DateTime.Now < n Loop End Sub
Theera Expert Licensed User Longtime User Feb 16, 2014 #4 Hi all, The wait() is alike doevents in vb6.0,isn't it? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 16, 2014 #5 No. It is not like DoEvents. The internal message queue is not processed. Upvote 0