Created
February 8, 2019 15:39
-
-
Save DenBond7/38e17d89d2626510cd3de93feed571b5 to your computer and use it in GitHub Desktop.
TimingLogger
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
// Before use it need run next command in terminal | |
// adb shell setprop log.tag.TAG VERBOSE | |
// Details here https://developer.android.com/reference/android/util/TimingLogger | |
TimingLogger timings = new TimingLogger(TAG, "methodA"); | |
// ... do some work A ... | |
timings.addSplit("work A"); | |
// ... do some work B ... | |
timings.addSplit("work B"); | |
// ... do some work C ... | |
timings.addSplit("work C"); | |
timings.dumpToLog(); | |
//Result will look like this | |
//D/TAG ( 3459): methodA: begin | |
//D/TAG ( 3459): methodA: 9 ms, work A | |
//D/TAG ( 3459): methodA: 1 ms, work B | |
//D/TAG ( 3459): methodA: 6 ms, work C | |
//D/TAG ( 3459): methodA: end, 16 ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment