code: public long getTime() throws NotAvailableException {
          synchronized (timeSync) {
              try {
                  if (!isRunning()) {
                      throw new InvalidStateException("Stopwatch was never started!");
                  }
  
                  if (endTime == -1) {
                      return System.currentTimeMillis() - startTime;
                  }
  
                  return endTime - startTime;
              } catch (CouldNotPerformException ex) {
                  throw new NotAvailableException(ContextType.INSTANCE, "time", ex);
              }
          }
      }
docs: This method returns the time interval between the start- and end timestamps.
  In case the the Stopwatch is still running, the elapsed time since Stopwatch start will be returned.
  
  @return the time interval in milliseconds.
  @throws NotAvailableException This exception will thrown in case the timer was never started.