The uptimeMillis method description says:
Returns the milliseconds since loading, not counting the time spent in deep sleep. Note: This value may get reset sometimes (otherwise wrap it before).
How often this can happen, and (more importantly) will affect Runnables, which must be carried out Handler.postAtTime ?
Inclusion of timetimeMillis in SystemTime (), which on a Linux system goes into clock_gettime (CLOCK_MONOTONIC, struct timespec *).
struct time_t, 32- . , , .
, clock_gettime (CLOCK_MONOTONIC) Linux.
uptimeMillis , , , postAtTime.
long Java :
-9,223,372,036,854,775,807 to 9,223,372,036,854,775,807 (~9.2E18)
9,2E18 - 292 277 266 . , , , , , , , .
, Android uptimeMillis
.,.
, , uptimeMillis reset - - !
I used it for a service and never saw it reset. I would suggest that this does not happen. The problem with this postAtTime()is that it will not be called during sleep (since uptimeMillis()it will not be updated). If this is a problem, I would use a different method.
postAtTime()
uptimeMillis()
Source: https://habr.com/ru/post/1783442/More articles:How to check Oracle sequences - sqlSQL Server 2008 - find out on which data line an error occurred (divide by zero) - sql-serverПеренаправление пользователей IE6 - redirectHow to ignore spaces in a string of a regular expression string, but only if it appears after a newline? - regexSQL Server 2000: How to get the top 10 for each individual field. Maybe a loop? - sql-serverRegExp in ActionScript 3: How to exclude a complex prefix? - regexCanonical embedded interactive Python interpreter example? - cIs it possible to get the URL of a user's homepage from a browser using JavaScript? - javascriptCan I create a date object when the year is not applicable? - javaCan you explain this weird behavior when dragging items into nested sorts? - javascriptAll Articles