Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.760
diff -u -p -r1.760 common.inc
--- includes/common.inc	17 Mar 2008 17:01:05 -0000	1.760
+++ includes/common.inc	21 Mar 2008 19:26:00 -0000
@@ -2487,8 +2487,26 @@ function drupal_cron_run() {
     // Lock cron semaphore
     variable_set('cron_semaphore', time());
 
+    // If you want to log cron timings for each module to the watchdog, 
+    // then add the following line to your settings.php
+    // 
+    // $conf = array ('cron_log_times' => 1);
+    $log_timing = variable_get('cron_log_times', 0);
     // Iterate through the modules calling their cron handlers (if any):
-    module_invoke_all('cron');
+    foreach (module_implements('cron') as $module) {
+      $function = $module .'_cron';
+      if ($log_timing) {
+        timer_start($function);
+      }
+      $function();
+      if ($log_timing) {
+        $timer = timer_stop($function);
+      }
+    
+      if ($log_timing) {
+        watchdog('cron', 'Cron time elapsed for @module is @millisecs ms.', array('@module' => $module, '@millisecs' => $timer['time']));
+      }
+    }
 
     // Record cron time
     variable_set('cron_last', time());
Index: sites/default/default.settings.php
===================================================================
RCS file: /cvs/drupal/drupal/sites/default/default.settings.php,v
retrieving revision 1.9
diff -u -p -r1.9 default.settings.php
--- sites/default/default.settings.php	21 Mar 2008 09:16:37 -0000	1.9
+++ sites/default/default.settings.php	21 Mar 2008 19:26:00 -0000
@@ -184,6 +184,14 @@ ini_set('url_rewriter.tags',        '');
  */
 #   'maintenance_theme' => 'minnelli', // Leave the comma here.
 /**
+ * Enable the following settings to make cron logs the time, in milliseconds
+ * taken for each hook_cron in all modules that implement it. This is helpful
+ * when you want to narrow down which module bogs down cron runs. The messages
+ * are logged to the watchdog, so you can see it in dblog or syslog, depending
+ * on which one you have configured.
+ */
+#   'cron_log_times' => 1, // Leave the comma here.
+/**
  * reverse_proxy accepts a boolean value.
  *
  * Enable this setting to determine the correct IP address of the remote
