Particle.process(), How long does it take?

Hi All,

I am just trouble shooting an issue that is further discussed here Serial.println() Blocking - #12 by StngBo

System settings


I am just wondering about Particle.process():

  1. How long does it take to return? I understand that delay() also effectively does the same thing as Particle.process().
  2. What is the relationship here, does delay() just repeatedly call Particle.process() for the time that is delayed?
  3. Are multiple calls to Particle.process() more effective than one singular, and if multiple are required, is there a range here that people have found as optimum.
  4. If a process has been blocking, is Particle.process() restorative, probably a bad choice of word, but does it repair a connection, assuming that the blocking process has harmed the connection.

Particle.process(); and delay(1); are essentially the same.

From the documentation: Using SYSTEM_THREAD(ENABLED) is recommended for most applications. When using threading mode you generally do not need to use Particle.process().

The caveat being unless your code blocks and prevents loop from returning and does not use delay() in any inner blocking loop.

I would also advise that you consider the internal log handler instead of using Serial.println, as the Log handler is thread safe and works much better in most instances.