? .buildpath
? .project
? .settings
? includes/table.inc
Index: includes/drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/drush.inc,v
retrieving revision 1.80
diff -u -p -b -r1.80 drush.inc
--- includes/drush.inc	21 Jan 2010 15:01:53 -0000	1.80
+++ includes/drush.inc	24 Jan 2010 16:35:19 -0000
@@ -1143,10 +1143,34 @@ function _drush_print_log($entry) {
 // Called at end of request. @see drush.php
 function drush_log_timers() {
   global $timers;
+  $temparray = array();
   foreach ((array)$timers as $name => $timerec) {
-    drush_log("Timer '$name' is  "  . sprintf('%s sec.', round(timer_read($name)/1000, 2)), 'timer');
+    // We have to use timer_read() for active timers, and check the record for others
+    if (isset($timerec['start'])) {
+      $temparray[$name] = timer_read($name);
   }
+    else {
+      $temparray[$name] = $timerec['time'];
+    }
+  }
+  // Put the highest cumulative times first
+  arsort($temparray);
+  $table = array();
+  $table[] = array('Timer', 'Cum (sec)', 'Count', 'Avg (msec)');
+  foreach ($temparray as $name => $time) {
+    $cum = round($time/1000, 3);
+    $count = $timers[$name]['count'];
+    if ($count > 0) {
+      $avg = round($time/$count, 3);
+    }
+    else {
+      $avg = 'N/A';
+    }
+    $table[] = array($name, $cum, $count, $avg);
+  }
+  drush_print_table($table, TRUE);
 }
+
 /**
 * Turn drupal_set_message errors into drush_log errors
 */
