title: Android - Get time of chronometer widget
body: <p>How to get the time from a Chronometer? I tried getText, getFormat, getBase, etc, but none of them could work.</p>
  
  <p>Example code snippet:</p>
  
  <pre><code>Chronometer t = (Chronometer)findViewById(R.id.toptime);
  long time = SystemClock.elapsedRealtime()-t.getBase();
  Log.d(null,"Was: "+time); //time is not the proper time for some reason - it is a random number between 0 and 50
  t.setBase(SystemClock.elapsedRealtime());
  t.start();
  </code></pre>