Last active
May 14, 2023 18:25
-
-
Save omkar-tenkale/c755c7c6a4ac830d65571d47d707776b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suspend fun calculateSquareRoot(number: Double): Double { | |
val block: (Continuation<Double>)->Any? = { | |
// Wait for result in current thread | |
kotlin.math.sqrt(number) | |
} | |
return suspendCoroutineUninterceptedOrReturn(block) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment