Skip to content

Instantly share code, notes, and snippets.

@recheej
Last active February 18, 2021 00:46

Revisions

  1. recheej renamed this gist Feb 18, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. recheej created this gist Feb 18, 2021.
    6 changes: 6 additions & 0 deletions simple suspend example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    suspend fun foo() {
    // let's assume called on main thread
    delay(1000) // resume in 1 second
    // we resumed after 1 second. which thread? that'll be answered in a future blog
    println("foo completed")
    }