RE: difference between IntervalMs and DelayMs

"'Tom Collins' tom-lnEA/wrDJtNWk0Htik3J/[email protected] [rabbit-semi]" <[email protected]> Wed, 5 Oct 2016 14:26:34 -0700
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
DelayMs(500) is supposed to wait 500ms.

 

IntervalMs(500) will wait until 500ms has elapsed since the last time you called it.

 

The difference is that if you have something you want to do every 500ms, use IntervalMs(500).  If you want to wait 500ms after you’ve completed a task before starting it again, use DelayMs(500).

 

If your task took exactly 100ms, the DelayMs() method would happen every 600ms whereas the IntervalMs() method would happen every 500ms.  I imagine IntervalMs() is handy when the task requires some variable amount of time.

 

I’m not sure why your controller would freeze when using DelayMs() versus IntervalMs(), and would suspect a bug elsewhere in your code.

 

-Tom

 

From: [email protected] [mailto:[email protected]] 
Sent: Friday, September 30, 2016 12:21 PM
To: [email protected]
Subject: [rabbit-semi] difference between IntervalMs and DelayMs

 

  

Hello,

 

I have couple costate loop. When I use wait(DelayMs(500)) after task is finished and make costate to wait, sometimes my controller is frozen, but when I use wait(IntervalMs(500)), it seems controller is working properly. 

 

Does any body know the difference between these two functions?

 

Thanks a lot. 

_,___