Skip to content

Instantly share code, notes, and snippets.

@LeonidIvankin
Created July 18, 2022 05:05
Show Gist options
  • Save LeonidIvankin/504a474e66443813af1372c53bf316cc to your computer and use it in GitHub Desktop.
Save LeonidIvankin/504a474e66443813af1372c53bf316cc to your computer and use it in GitHub Desktop.
package com.leonidivankin.draftandroid.articles.benchmark
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.leonidivankin.draftandroid.R
class XmlWidthActivity : AppCompatActivity() {
var time = 0L
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
title = "xml, width"
time = System.currentTimeMillis()
setContentView(R.layout.activity_xml_width)
}
override fun onResume() {
super.onResume()
Log.d("Benchmark", "XmlWidthActivity onResume: ${System.currentTimeMillis() - time}")
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
Log.d(
"Benchmark",
"XmlWidthActivity onWindowFocusChanged: ${System.currentTimeMillis() - time}"
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment