runIn(), runOnce(), pause(msec) which one to use in this example

I’m not entirely sure how pause or runIn work, but I’ll guess.

Pause could be some kind of busy wait, in which case that would explain why the SmartApp hits the timeout. It could be like a coroutine yield, which would save state and release resources while paused.

The runIn is definitely releasing resources and setting a timer to call the specified function. It doesn’t require saving any additional state.

1 Like