Last active
November 11, 2023 19:48
-
-
Save af2905/6269bde77fe97653b56d49d30342aee4 to your computer and use it in GitHub Desktop.
receive_data_on_background_thread
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 thread = Thread { | |
val (result: String, duration: Duration) = measureTimedValue { receiveData() } | |
Log.d("TAG", "$result after ${duration.toDouble(DurationUnit.MILLISECONDS)} ms.") | |
showToast(context = this, message = result) | |
} | |
thread.start() | |
Log.d("TAG", "onCreate completed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment