Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8334869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:29:17+00:00 2026-06-09T03:29:17+00:00

SystemClock.uptimeMillis() This call from the Android SystemClock will reset back to zero before it

  • 0
SystemClock.uptimeMillis()

This call from the Android SystemClock will reset back to zero before it ‘Maxes Out’

Right now I use this to base off animations, movement etc below is an example of where a reset would essentially freeze my application.

if (currentTime > frameTime + sequenceTime)
{
    frameTime = currentTime;
}

Here lies the problem currentTime is say 50 then the frameTime is set to 50 right? Ideally the currentTimewould increase with the SystemClock.uptimeMillis() but if its reset? The currentTime becomes very small compared to the frameTime How would I go about fixing this or reset the currentTime for all objects?

This is just a small example if I have different objects having a similar dilemma.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:29:18+00:00Added an answer on June 9, 2026 at 3:29 am

    From my reading of the documentation, the “uptime” clock only gets reset when the device is rebooted. Unless your application … somehow … manages to keep running over a reboot, you shouldn’t need to worry about the clock resetting.

    (On the other hand, if your application does need to do animations that keep going after a reboot, then maybe you should use the ‘currentTimeMillis’ clock. The Android documentation for SystemClock describes the alternatives.)


    The documentation says this “Note: This value may get reset occasionally (before it would otherwise wrap around).”.

    This doesn’t make a lot of sense to me. The clock is a millisecond clock and is returned as a long, so you would not expect it to ever wrap around. (2^64 milliseconds is a very, very long time.) The only explanation I can think of is that some devices use a 32 bit hardware timer to implement this clock … which is kind of lame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it correct to compare two values resulting from a call to System.nanoTime() on
I am using the SystemClock.elapsedRealtime() to display the time. But now I want to
The code that follows comes from p.58-61 of the book Android Developer's Cookbook. The
I'm trying to understand OpenGL ES 2.0 in android. I got a code from
I have a receiver that start after phone boot like this: <receiver android:name=.OnBootReceiver >
So today I upgraded from gingerbread to Ice Cream sandwich. Other changes I did
I have this code Calendar c = new GregorianCalendar(); c.add(Calendar.DAY_OF_YEAR, 1); c.set(Calendar.HOUR_OF_DAY, 23); c.set(Calendar.MINUTE,
I just started to learn Android, I'm trying to write a widget which is
What I want is a Chronometer UI component which goes back. In standard Chronometer
For some reason, Toast.makeText().show() and dialog.show() calls do nothing when called from test methods

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.