Last active
November 11, 2023 20:46
-
-
Save af2905/b9cd48a99a870936cfdb4ab9497d8640 to your computer and use it in GitHub Desktop.
receive_data_coroutine_dispatcher_main
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.Main) | |
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