• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package simpleperf.example.kotlin
2 
3 import androidx.appcompat.app.AppCompatActivity
4 import android.os.Bundle
5 
6 class MainActivity : AppCompatActivity() {
onCreatenull7     override fun onCreate(savedInstanceState: Bundle?) {
8         super.onCreate(savedInstanceState)
9         setContentView(R.layout.activity_main)
10         createBusyThread()
11     }
12 
createBusyThreadnull13     fun createBusyThread() {
14         object : Thread() {
15             var i = 0
16 
17             override fun run() {
18                 while (true) {
19                     i = callFunction(i)
20                 }
21             }
22 
23             fun callFunction(i: Int): Int {
24                 return i + 1
25             }
26         }.start()
27     }
28 }