title: Correct way to find current time in milliseconds within Android draw loop
body: <p>I'm trying to get rid of as much object creation as possible in my Android app's Draw() loop to minimize garbage collection, and I'm having trouble dealing with time.  I know of two ways to get the current time:</p>
  
  <p>1) java.util.Calendar</p>
  
  <pre><code>long now = Calendar.getInstance().getTimeInMillis();
  </code></pre>
  
  <p>This works fine, but (as far as I can tell) the only way to get a Calendar object to be set to the current time is to call Calendar.getInstance(), and every call to getInstance() creates a new int[].</p>
  
  <p>2) android.text.format.Time</p>
  
  <pre><code>Time time = new Time();
  time.setToNow();
  long now = time.toMillis(true);
  </code></pre>
  
  <p>This can be done without instantiating any new object each time it's called, but setToNow() appears to only be accurate to the nearest second.</p>
  
  <p>How can I get the current system time, to the nearest milli, without incurring garbage collection in my Draw loop?</p>