long uptimeMs = SystemClock.uptimeMillis();Gives milliseconds since the device was booted.
Programming Tips - Android: programmatically get uptime
Date: 2019dec5
Q. Android: programmatically get uptime
A.