James Gu
James Gu

Reputation: 1392

Android check device running time since last reboot

I wonder is there a way to get the time that the device has been running since last reboot?

Upvotes: 11

Views: 24822

Answers (2)

Dannie
Dannie

Reputation: 2480

From: http://developer.android.com/reference/android/os/SystemClock.html

SystemClock.elapsedRealtime()

elapsedRealtime() and elapsedRealtimeNanos() return the time since the system was booted, and include deep sleep. This clock is guaranteed to be monotonic, and continues to tick even when the CPU is in power saving modes, so is the recommend basis for general purpose interval timing.

Upvotes: 15

Watki02
Watki02

Reputation: 4886

Per the answer to this other question:

Go to Settings>About Phone>Status and scroll to the end of the options. You'll see the up time.

Upvotes: 10

Related Questions