private void PrintProgressLine(TextWriter writer, ProgressReporting.ProgressEvent ev)
            {
                // Elapsed time.
                var elapsed = ev.EventTime - ev.StartTime;

                if (elapsed.TotalMinutes < 1)
                {
                    writer.Write("(00:{0:00.00})", elapsed.TotalSeconds);
                }
                else if (elapsed.TotalHours < 1)
                {
                    writer.Write("({0:00}:{1:00.0})", elapsed.Minutes, elapsed.TotalSeconds - 60 * elapsed.Minutes);
                }
                else
                {
                    writer.Write("({0:00}:{1:00}:{2:00})", elapsed.Hours, elapsed.Minutes, elapsed.Seconds);
                }

                // Progress units.
                bool first = true;

                for (int i = 0; i < ev.ProgressEntry.Header.UnitNames.Length; i++)
                {
                    if (ev.ProgressEntry.Progress[i] == null)
                    {
                        continue;
                    }
                    writer.Write(first ? "\t" : ", ");
                    first = false;
                    writer.Write("{0}", ev.ProgressEntry.Progress[i]);
                    if (ev.ProgressEntry.ProgressLim[i] != null)
                    {
                        writer.Write("/{0}", ev.ProgressEntry.ProgressLim[i].Value);
                    }
                    writer.Write(" {0}", ev.ProgressEntry.Header.UnitNames[i]);
                }

                // Metrics.
                for (int i = 0; i < ev.ProgressEntry.Header.MetricNames.Length; i++)
                {
                    if (ev.ProgressEntry.Metrics[i] == null)
                    {
                        continue;
                    }
                    // REVIEW: print metrics prettier.
                    writer.Write("\t{0}: {1}", ev.ProgressEntry.Header.MetricNames[i], ev.ProgressEntry.Metrics[i].Value);
                }

                writer.WriteLine();
            }
 private static void PrintOperationStop(TextWriter writer, ProgressReporting.ProgressEvent ev)
 {
     writer.WriteLine("[{0}] '{1}' finished in {2}.", ev.Index, ev.Name, ev.EventTime - ev.StartTime);
 }
 private static void PrintOperationStart(TextWriter writer, ProgressReporting.ProgressEvent ev)
 {
     writer.WriteLine("[{0}] '{1}' started.", ev.Index, ev.Name);
 }