Is there an easy possibility to measure the startup time an application takes? Similar questions are asking regarding self-made apps, but in this case I am talking about foreign apps to test and compare them. So far I couldn't find a simple app in the Play Store/iTunes App Store which just measures the time from the point where the user clicks the app icon to the state where it is fully loaded and can be worked with. I'd be thankful for any hints!
-
https://en.wikipedia.org/wiki/Stopwatch ;-) – Krumelur Oct 17 '16 at 08:18
-
Come on ;-) I was hoping for some accurate measuring within the range of milliseconds. – UserSoUndSo Oct 17 '16 at 08:33
-
you can measure only self made app task time not for all the apps install in your device. – Gagan_iOS Oct 17 '16 at 09:29
2 Answers
Put this code as your first line of code in the main activity :
Log.d("MyApp start time", "" + System.currentTimeMillis());
And after you consider the app loading ended put:
Log.d("MyApp end time", "" + System.currentTimeMillis());
Now just search the log for the info and you will the times over there

- 386
- 1
- 11
Try this tutorial or create separate application which will start your app (via Intent) and write to log (or save to file) current time (System.currentTimeMillis()
) just before startActivity(intent)
.
Update:
In case foreign apps of You have create separate application which will start other app (via Intent) and write to log (or save to file or just store in variable) current time System.currentTimeMillis()
just before startActivity(intent)
like that:
Intent intent = getPackageManager().getLaunchIntentForPackage("<package of other app>");
if (intent!= null) {
Log.d(TAG, "Starting time: " + System.currentTimeMillis());
startActivity(intent);
}
(You can get other app package and main activity name this way) and than get launched apps list (or monitor logcat of them) like in that thread and when app appears in list or its log detected You can store timestamp of launched app. Difference between stored values indicates time for launch.

- 1
- 1

- 13,183
- 12
- 43
- 79
-
1In the question it is stated that the stats are to be measured for "foreign apps" not self made – Atif Farrukh Oct 17 '16 at 10:47