问题
I launch a activity use:
am start -W -n
The console output:
tangbincheng@tangbinchengdeMacBook-Pro:~$ adb shell
shell@hwp6-t00:/ $ su
root@hwp6-t00:/ # am start -W -n com.book2345.reader/com.book2345.reader.MainA>
Starting: Intent { cmp=com.book2345.reader/.MainActivity }
Status: ok
Activity: com.book2345.reader/.MainActivity
ThisTime: 1554
TotalTime: 42815
Complete
what the ThisTime
and the TotalTime
mean?
回答1:
search in android source code: You can find "thisTime/totalTime"
"thisTime": just current activity launched time
"totalTime":the activity you started may be on the bottom of activity stack. So it refers to the total time from activity searching to current activity launched.
final long thisTime = curTime - displayStartTime;
final long totalTime = stack.mLaunchStartTime != 0
? (curTime - stack.mLaunchStartTime) : thisTime;
来源:https://stackoverflow.com/questions/27736882/when-am-start-a-activity-what-the-total-time-mean