如何获得Android系统的正常运行时间,并实时命令行?命令行、正常运行、如何获得、实时

2023-09-05 23:19:10 作者:扯不断的是回忆

我在写包含几个亚行的shell命令的脚本。我也想要录制的时候,程序实时和正常运行时间的一种形式执行这些命令。我知道我可以通过SystemClock正常运行时间和实时的:

I'm writing a script containing several "adb shell" command. I also want to record the time when program execute these command in a form of realtime and uptime. I know I can get uptime and realtime through SystemClock:

SystemClock.uptimeMillis();
SystemClock.elapsedRealtime();

有没有什么办法可以在命令行中,这些信息?

Is there any way I can get these information from the command line?

非常感谢!

推荐答案

尝试:

adb shell cat /proc/uptime