Commit graph

5 commits

Author SHA1 Message Date
Greg Hackmann
fa66f1e494 toolbox: uptime: use clock_gettime() on devices without /dev/alarm
Change-Id: Id7287ca179cc0b8390c054803a25a961dd550a34
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-12-17 14:45:39 -08:00
Greg Hackmann
7f625ed026 toolbox: uptime: fix unused parameter warnings
Change-Id: Id240ce85bf09e1a81f4e2e2a7496ac7952edbf38
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-12-17 14:45:39 -08:00
Colin Cross
9d6d030f83 uptime: Use clock_gettime to get monotonic time
The first field in /proc/uptime is bootbased time, not monotonic
time.  If the kernel tracks bootbased time correctly, it counts
elapsed run time as well as sleep time, which is the same as the
elapsed time in the android alarm driver, and sleep time is
always returned as 0.

Use clock_gettime(CLOCK_MONOTONIC) instead, which will return
elapsed run time not counting sleep time on all platforms.

Change-Id: I28a22e8c93d78f62666ee8c877c7c6718a2b640a
2011-01-05 15:22:09 -08:00
Kenny Root
53308d4cd5 Correct copyright header for uptime and NOTICE
Change-Id: I89f91c21db87955b20b1ef9b4590f7009f106b26
2010-07-27 11:26:06 -07:00
Mike Lockwood
5ffbf26ebf toolbox: add "uptime" command
Prints elapsed real time since boot, as well as idle time and sleep time.

Change-Id: I97f482d6087e9f802d74e91147bf767e6b2d4f42
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-09 16:42:42 -04:00