Last active
November 11, 2023 20:11
-
-
Save af2905/2ab0cab408c9a6341dc7c6aeb859bce1 to your computer and use it in GitHub Desktop.
receive_data_coroutine_dispatcher_io
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
val scope = CoroutineScope(Dispatchers.IO) | |
scope.launch { | |
val (result: String, duration: Duration) = measureTimedValue { receiveData() } | |
Log.d("TAG", "$result after ${duration.toDouble(DurationUnit.MILLISECONDS)} ms.") | |
showToast(context = this@MainActivity, message = result) | |
} | |
Log.d("TAG", "onCreate completed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment