adb getevent time format

2019-03-04 19:24发布

adb shell getevent -tl

I'm running the command above and getting output as I'd expect. The timestamp, however, is in an odd format (it's inside of the brackets, below). What time format is this, and how would I go about converting it to a human readable time?

[   25475.498826] /dev/input/event6: EV_SYN       SYN_REPORT           00000000            

标签: android adb
1条回答
在下西门庆
2楼-- · 2019-03-04 19:41

The timestamp is in timeval format. Its absolute value has no meaning. Its purpose is to allow to calculate intervals between separate events.

One more time, there is no universal meaning to the absolute value of the getevent timestamp. In some cases it might look like system uptime or epoch time but it is not guaranteed to be the same on other devices or even on the same device under different conditions. Kernel uses this timestamp to calculate the time delta between separate events, nothing more. The absolute value does not matter.

The way you convert it to a human readable format is by selecting relatively small group of events and subtracting the timestamp of the first event from timestamps of all events in that group. Treat the resulting numbers like any other fractional seconds.

查看更多
登录 后发表回答