title: Java getElapsedTime in simple Stopwatch, returning the enum
body: <p>I made in Java a simple stopWatch for measuring time. One method of this class is:</p>
  
  <pre><code>public long[] getElapsedTime() {
          long timestamp;
          timestamp = (running) ? ((System.currentTimeMillis() / 1000) - (startTime / 1000)) : (((stopTime - startTime) / 1000));
          long day = TimeUnit.SECONDS.toDays(timestamp);
          long hours = TimeUnit.SECONDS.toHours(timestamp) - (day * 24);
          long minutes = TimeUnit.SECONDS.toMinutes(timestamp) - (TimeUnit.SECONDS.toHours(timestamp) * 60);
          long seconds = TimeUnit.SECONDS.toSeconds(timestamp) - (TimeUnit.SECONDS.toMinutes(timestamp) * 60);
          return new long[] {day, hours, minutes, seconds};
      }
  </code></pre>
  
  <p>Method return a array with 4 members. But the calling of this method is so strange:</p>
  
  <pre><code>new Formatter().format("%02d:%02d:%02d", stopwatch.getElapsedTime()[1], stopwatch.getElapsedTime()[2], stopwatch.getElapsedTime()[3] ))
  </code></pre>
  
  <p>Can I make return this as some <b>"enum"</b> or something more human readable format? I imagine the implementation like this:</p>
  
  <pre><code>new Formatter().format("%02d:%02d:%02d", stopwatch.getElapsedTime().HOURS, stopwatch.getElapsedTime().MINUTES, stopwatch.getElapsedTime().SECONDS ))
  </code></pre>
  
  <p>It is possible?</p>
  
  <p>I know that I can set elapsed time units in the class (class is not static) and then make <b>getters</b> for the units (e.g. <em>getDays()</em>, <em>getHours()</em>, <em>getMinutes()</em> and <em>getSeconds()</em>) But I think that this is not my imagine.</p>
  
  <p>Thanks for any hints.</p>