mksh

How to measure time from adb shell with milliseconds resolution?

时光怂恿深爱的人放手 提交于 2019-12-17 13:59:31
问题 How can I measure time from adb shell with milliseconds or nanoseconds resolution? Using date +%.%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? 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

How to measure time from adb shell with milliseconds resolution?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 13:59:26
问题 How can I measure time from adb shell with milliseconds or nanoseconds resolution? Using date +%.%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? 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

How to measure time from adb shell with milliseconds resolution?

a 夏天 提交于 2019-12-17 13:58:27
问题 How can I measure time from adb shell with milliseconds or nanoseconds resolution? Using date +%.%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? 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

adb shell regular expression doesn't work as tested locally

放肆的年华 提交于 2019-12-13 07:04:18
问题 First, sorry if my question is obscure or in an inconvenient format. This is my first post here :D. My issue is that I have a script, let's say test.sh which reads an input, and validates if it's a positive integer (reg ex used from this post: BASH: Test whether string is valid as an integer?): #!/bin/sh echo -n " enter number <" read num if [[ $num =~ ^-?[0-9]+$ ]] #if num contains any symbols/letters then # anywhere in the string echo "not a positive int" exit else echo "positive int read"

Using “printf” for hex values in android shell

人走茶凉 提交于 2019-12-02 07:53:38
I am porting my shell script (quite big shell script) from bash to android shell (mksh shell). In Android, printf does not seem to be working the same way as it works in other Linux systems. Sample code : $ cat sample.sh ... func1() { A=100 HEXA=`printf "%04x" ${A}` echo "A - ${A} HEXA - ${HEXA}" } func1 This function's output is as follows. $ ./sample.sh A - 100 HEXA - 300000078 It is printing a really weird number. I saw from other posts and from the manpage of mksh that printf is not recommended to be used in mksh . My shell script, which is quite big, is using it very heavily. So, I want

Using “printf” for hex values in android shell

你说的曾经没有我的故事 提交于 2019-12-02 06:54:11
问题 I am porting my shell script (quite big shell script) from bash to android shell (mksh shell). In Android, printf does not seem to be working the same way as it works in other Linux systems. Sample code : $ cat sample.sh ... func1() { A=100 HEXA=`printf "%04x" ${A}` echo "A - ${A} HEXA - ${HEXA}" } func1 This function's output is as follows. $ ./sample.sh A - 100 HEXA - 300000078 It is printing a really weird number. I saw from other posts and from the manpage of mksh that printf is not

How to measure time from adb shell with milliseconds resolution?

爷,独闯天下 提交于 2019-11-27 15:34:51
How can I measure time from adb shell with milliseconds or nanoseconds resolution? Using date +%.%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? 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 . mksh (the standard Android shell since version 4.0) has a