如何衡量亚行壳毫秒解决时间? [英] How to measure time from adb shell with milliseconds resolution?

查看:254
本文介绍了如何衡量亚行壳毫秒解决时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能测量从亚行壳毫秒或纳秒解决时间?

How can I measure time from adb shell with milliseconds or nanoseconds resolution?

使用日期+%。%N 亚行的shell返回 1401546811.N (秒分辨率),而不是其他如 1401547289.231869798 (纳秒级分辨率)。

Usingdate +%.%N from adb shell returns 1401546811.N (seconds resolution) instead of something like 1401547289.231869798 (nanoseconds resolution).

我怎样才能从亚行外壳无论是毫秒或纳秒的分辨率是多少?

How can I get either milliseconds or nanoseconds resolution from adb shell?

有一些终端程序,我可以用它来给我这个? 我能够用测量时间 System.currentTimeMillis的() System.nanoTime()从Android应用程序code本身,但我还需要从一些在亚行外壳

Is there some terminal program that I can use to give me this? I am able to measure time using System.currentTimeMillis() and System.nanoTime() from Android application code itself, but I also need something from within adb shell.

推荐答案

根据不同的外壳版本,你可以使用 EPOCHREALTIME 环境变量:

Depending on the shell version you could use EPOCHREALTIME environment variable:

$ adb shell echo \$EPOCHREALTIME
1402003597.273141

这篇关于如何衡量亚行壳毫秒解决时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆