Android docs in uptimeMillis () say:
Returns the milliseconds since loading, not counting the time spent in deep sleep. Note This value can sometimes appear reset (before it otherwise turns around).
It seems rather strange that the documents worry about it ever wrap around. In the end, the method returns long. A quick calculation suggests that it will take approximately 292,271,022 years for him to ever turn around.
So what about the documents? Is it really possible to wrap it? Can a value wrap before it reaches its maximum value for a long time? Is this what the documents are actually trying to say? And if so, when will this happen?
[This is especially perplexing, since System.currentTimeMillis () is also long, which represents time from the era. However, Android absolutely does not mention the possibility of transferring value. Especially for uptimeMillis, which starts with 0 ...]
source share