Is there a way to create a sleep/pause/delay in my app without runIn?

I've written an app and I want to create a 5 second delay between trying to program a door lock with setCode. The problem is that I want the action to be synchronous, not scheduled. So the logic goes like this:

  1. Set door lock with code
  2. Wait 5 seconds - This is where I'm having trouble. I don't see how runIn() helps with this.
  3. Check if code was successfully programmed / detected - If success - send Success push notification
  4. If not, repeat above sequence
  5. If all attempts are exhausted - send Failure push notification

Any suggestions?

1 Like

Answered my own damn question. use pauseExecution(int milliseconds). For the life of me, i don't know why I didn't see this in the common methods documentation as many times as I looked.

1 Like