Prints out the average time difference from a collection of {@code com.twelvemonkeys.util.DebugUtil.TimeDifference} objects.
<p>

@param pTimeDifferences
@param pPrintStream the {@code java.io.PrintStream} for flushing the results.
343410
public static void printTimeAverage(final Collection pTimeDifferences, final PrintStream pPrintStream) {

    if (pPrintStream == null) {
      System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
      return;
    }
    if (pTimeDifferences == null) {
      pPrintStream.println(TIMEDIFFERENCES_IS_NULL_ERROR_MESSAGE);
      return;
    }
    Object         o;
    TimeDifference timeDifference;
    Calendar       startCalendar      = null;
    Calendar       endCalendar        = null;
    Calendar       totalStartCalendar = null;
    Calendar       totalEndCalendar   = null;
    long           startCalendarMilliSeconds, endCalendarMilliSeconds;
    List           timeDifferenceList = new Vector();
    Iterator       i                  = pTimeDifferences.iterator();

    if (i.hasNext()) {
      o = i.next();
      if (!(o instanceof TimeDifference)) {
        pPrintStream.println(TIMEDIFFERENCES_WRONG_DATATYPE_ERROR_MESSAGE);
        return;
      }
      timeDifference            = (TimeDifference) o;
      startCalendar             = timeDifference.getStartCalendar();
      totalStartCalendar        = startCalendar;
      endCalendar               = timeDifference.getEndCalendar();
      startCalendarMilliSeconds = startCalendar.getTime().getTime();
      endCalendarMilliSeconds   = endCalendar.getTime().getTime();
      timeDifferenceList.add(new Long(endCalendarMilliSeconds - startCalendarMilliSeconds));
    }
    while (i.hasNext()) {
      o = i.next();
      if (!(o instanceof TimeDifference)) {
        pPrintStream.println(TIMEDIFFERENCES_WRONG_DATATYPE_ERROR_MESSAGE);
        return;
      }
      timeDifference            = (TimeDifference) o;
      startCalendar             = timeDifference.getStartCalendar();
      endCalendar               = timeDifference.getEndCalendar();
      startCalendarMilliSeconds = startCalendar.getTime().getTime();
      endCalendarMilliSeconds   = endCalendar.getTime().getTime();
      timeDifferenceList.add(new Long(endCalendarMilliSeconds - startCalendarMilliSeconds));
    }
    totalEndCalendar = endCalendar;
    int  numberOfElements = timeDifferenceList.size();
    long timeDifferenceElement;
    long timeDifferenceSum = 0;

    for (Iterator i2 = timeDifferenceList.iterator(); i2.hasNext(); ) {
      timeDifferenceElement = ((Long) i2.next()).longValue();
      timeDifferenceSum     += timeDifferenceElement;
    }

    // Total elapsed time
    String totalElapsedTime = buildTimeDifference(totalStartCalendar, totalEndCalendar);

    // Time average presentation format
    pPrintStream.println("Average time difference: " + timeDifferenceSum / numberOfElements + "ms (" + numberOfElements
                         + " elements, total elapsed time: " + totalElapsedTime + ")");
  }
287200
private void writeToWithMetrics(final OutputStream outstream) throws IOException {
        if (outstream == null) {
            throw new IllegalArgumentException("Output stream may not be null");
        }
        final InputStream content = getContent();
        final long length = getContentLength();
        InputStream instream = content;
        try {
            byte[] buffer = new byte[BUFFER_SIZE];
            int l;
            if (length < 0) {
                // consume until EOF
                while ((l = instream.read(buffer)) != -1) {
                    long startNano = helper.startTiming();
                    outstream.write(buffer, 0, l);
                    helper.increment(l, startNano);
                }
            } else {
                // consume no more than length
                long remaining = length;
                while (remaining > 0) {
                    l = instream.read(buffer, 0, (int)Math.min(BUFFER_SIZE, remaining));
                    if (l == -1) {
                        break;
                    }
                    long startNano = helper.startTiming();
                    outstream.write(buffer, 0, l);
                    helper.increment(l, startNano);
                    remaining -= l;
                }
            }
        } finally {
            helper.reportMetrics();
            instream.close();
        }
    }
202111
private void writeObject(final java.io.ObjectOutputStream out)
     throws IOException {
     out.writeObject(inequalitySymbol);
     out.writeLong(timeStamp);
   }
1253521
public void printUsage(PrintStream ps) {
    hasListOption = false;
    if (usageSynopsis != null) {
      ps.printf("Usage: %s%n", usageSynopsis);
    }
    ps.println(usage());
    if (hasListOption) {
      ps.println();
      ps.println(LIST_HELP);
    }
  }
280896
public synchronized void print(PrintStream p) {
        for (int i = 0; i < nkeys; i++)
            if (keys[i] != null) {
                p.print(keys[i] +
                    (values[i] != null ? ": "+values[i]: "") + "\r\n");
            }
        p.print("\r\n");
        p.flush();
    }
467273
public static long getDifference(Time timeFrom, Time timeTo) {
		try {
			DateFormat format = new SimpleDateFormat("HH:mm:ss");
			// the a means am/pm marker
			Date date = format.parse(timeFrom.toString());
			Date date2 = format.parse(timeTo.toString());
			long difference = (date2.getTime() - date.getTime()) / 1000 / 60;
			return difference;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
1216555
public void printTo(Appendable appendable, ReadableInstant instant) throws IOException {
        long millis = DateTimeUtils.getInstantMillis(instant);
        Chronology chrono = DateTimeUtils.getInstantChronology(instant);
        printTo(appendable, millis, chrono);
    }
112468
public static final BigInteger printDurationInIntegerTenthsOfMinutes(Duration duration)
   {
      BigInteger result = null;

      if (duration != null && duration.getDuration() != 0)
      {
         result = BigInteger.valueOf((long) printDurationFractionsOfMinutes(duration, 10));
      }

      return result;
   }
1004950
public static void printDebug(final String[] pStringArray, final PrintStream pPrintStream) {

    if (pPrintStream == null) {
      System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
      return;
    }
    if (pStringArray == null) {
      pPrintStream.println(STRINGARRAY_IS_NULL_ERROR_MESSAGE);
      return;
    }
    for (int i = 0; i < pStringArray.length; i++) {
      pPrintStream.println(pStringArray[i]);
    }
  }
110093
public void print(PrintStream ps, String message){
        if(SUPPORTED)
            ps.print(start);
        ps.print(message);
        if(SUPPORTED)
            ps.print(END);
    }
193430
public static final BigInteger printTimeUnit(TimeUnit value)
   {
      return (BigInteger.valueOf(value == null ? TimeUnit.DAYS.getValue() + 1 : value.getValue() + 1));
   }
1242061
public void print(final PrintStream out, final ICodingAnnotationStudy study,
			final IDistanceFunction distanceFunction) {
		doPrint(out, study.getCategories(), study, distanceFunction);
	}
964611
public static void printDate(PrintWriter pw, String value) {
	long millis = System.currentTimeMillis();
	pw.write(FORMAT.format(new Date(millis)) + " " + value + "\n");
	pw.flush();
    }
935521
private static final double printDurationFractionsOfMinutes(Duration duration, int factor)
   {
      double result = 0;

      if (duration != null)
      {
         result = duration.getDuration();

         switch (duration.getUnits())
         {
            case HOURS:
            case ELAPSED_HOURS:
            {
               result *= 60;
               break;
            }

            case DAYS:
            {
               result *= (60 * 8);
               break;
            }

            case ELAPSED_DAYS:
            {
               result *= (60 * 24);
               break;
            }

            case WEEKS:
            {
               result *= (60 * 8 * 5);
               break;
            }

            case ELAPSED_WEEKS:
            {
               result *= (60 * 24 * 7);
               break;
            }

            case MONTHS:
            {
               result *= (60 * 8 * 5 * 4);
               break;
            }

            case ELAPSED_MONTHS:
            {
               result *= (60 * 24 * 30);
               break;
            }

            case YEARS:
            {
               result *= (60 * 8 * 5 * 52);
               break;
            }

            case ELAPSED_YEARS:
            {
               result *= (60 * 24 * 365);
               break;
            }

            default:
            {
               break;
            }
         }
      }

      result *= factor;

      return (result);
   }
1205018
def pprint(self, seconds):
        
        return ("%d:%02d:%02d.%03d", reduce(lambda ll, b: divmod(ll[0], b) + ll[1:], [(seconds * 1000,), 1000, 60, 60]))
1011312
public static final String printDuration(Duration duration)
   {
      String result = null;
      if (duration != null)
      {
         result = duration.getDuration() + " " + printTimeUnits(duration.getUnits());
      }
      return result;
   }
26909
public void sparsePrint(PrintStream stream) {
    if (mSeries.isEmpty()) {
      return;
    }
    long start = mSeries.firstKey();
    stream.printf("Time series starts at %d with width %d.%n", start, mWidthNano);

    for (Map.Entry<Long, Integer> entry : mSeries.entrySet()) {
      stream.printf("%d %d%n", (entry.getKey() - start) / mWidthNano, entry.getValue());
    }
  }