title: Repeating coroutine with delays
body: <p>I am looking a way to launch a thread that would make a GUI element blink forever, in pseudo-code:</p>
  <pre><code>while (true) {
    GUI element ON
    wait for 1s
    element OFF
    wait for 1s
  }
  </code></pre>
  <p>I'm thinking of a recursive chain of handlers, like this:</p>
  <pre><code>val handler = Handler()
  handler.postDelayed({
      Handler().postDelayed({ gui_element_on() }, 1000)
      Handler().postDelayed({ gui_element_off() }, 1000)
      handler.postDelayed(this,0)
  }, 1000)
  </code></pre>
  <p>Only that this won't work. I don't know how to do it properly. And I am not sure if this is the most efficient way.</p>