wro4j-core/src/main/java/ro/isdc/wro/util/StopWatch.java
public String prettyPrint() {
    final StringBuffer sb = new StringBuffer(shortSummary());
    sb.append('\n');
    if (!this.keepTaskList) {
      sb.append("No task info kept");
    } else {
      final TaskInfo[] tasks = getTaskInfo();
      sb.append("-----------------------------------------\n");
      sb.append("ms     %     Task name\n");
      sb.append("-----------------------------------------\n");
      final NumberFormat nf = NumberFormat.getNumberInstance();
      nf.setMinimumIntegerDigits(5);
      nf.setGroupingUsed(false);
      final NumberFormat pf = NumberFormat.getPercentInstance();
      pf.setMinimumIntegerDigits(3);
      pf.setGroupingUsed(false);
      for (final TaskInfo task : tasks) {
        sb.append(nf.format(task.getTimeMillis()) + "  ");
        final double totalTimeSeconds = getTotalTimeSeconds();
        final double percentage = totalTimeSeconds == 0 ? 0 : task.getTimeSeconds() / totalTimeSeconds;
        sb.append(pf.format(percentage) + "  ");
        sb.append(task.getTaskName() + "\n");
      }
    }
    return sb.toString();
  }
public String prettyPrint() {
    final StringBuffer sb = new StringBuffer(shortSummary());
    sb.append('\n');
    if (!this.keepTaskList) {
      sb.append("No task info kept");
    } else {
      final TaskInfo[] tasks = getTaskInfo();
      sb.append("-----------------------------------------\n");
      sb.append("ms     %     Task name\n");
      sb.append("-----------------------------------------\n");
      final NumberFormat nf = NumberFormat.getNumberInstance();
      nf.setMinimumIntegerDigits(5);
      nf.setGroupingUsed(false);
      final NumberFormat pf = NumberFormat.getPercentInstance();
      pf.setMinimumIntegerDigits(3);
      pf.setGroupingUsed(false);
      for (final TaskInfo task : tasks) {
        sb.append(nf.format(task.getTimeMillis()) + "  ");
        final double totalTimeSeconds = getTotalTimeSeconds();
        final double percentage = totalTimeSeconds == 0 ? 0 : task.getTimeSeconds() / totalTimeSeconds;
        sb.append(pf.format(percentage) + "  ");
        sb.append(task.getTaskName() + "\n");
      }
    }
    return sb.toString();
  }
public String prettyPrint ( ) { final StringBuffer sb = new StringBuffer ( shortSummary ( ) ) ; sb . append ( ' ' ) ; if ( ! this . keepTaskList ) { sb . append ( "No task info kept" ) ; } else { final TaskInfo [ ] tasks = getTaskInfo ( ) ; sb . append ( "-----------------------------------------\n" ) ; sb . append ( "ms     %     Task name\n" ) ; sb . append ( "-----------------------------------------\n" ) ; final NumberFormat nf = NumberFormat . getNumberInstance ( ) ; nf . setMinimumIntegerDigits ( 5 ) ; nf . setGroupingUsed ( false ) ; final NumberFormat pf = NumberFormat . getPercentInstance ( ) ; pf . setMinimumIntegerDigits ( 3 ) ; pf . setGroupingUsed ( false ) ; for ( final TaskInfo task : tasks ) { sb . append ( nf . format ( task . getTimeMillis ( ) ) + "  " ) ; final double totalTimeSeconds = getTotalTimeSeconds ( ) ; final double percentage = totalTimeSeconds == 0 ? 0 : task . getTimeSeconds ( ) / totalTimeSeconds ; sb . append ( pf . format ( percentage ) + "  " ) ; sb . append ( task . getTaskName ( ) + "\n" ) ; } } return sb . toString ( ) ; }
Return a string with a table describing all tasks performed. For custom reporting, call getTaskInfo() and use the
task info directly.
Return a string with a table describing all tasks performed . For custom reporting call getTaskInfo () and use the task info directly .