Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.758
diff -u -F^f -r1.758 common.inc
--- includes/common.inc	18 Feb 2008 16:53:36 -0000	1.758
+++ includes/common.inc	18 Feb 2008 18:30:07 -0000
@@ -2528,8 +2528,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.8
diff -u -F^f -r1.8 default.settings.php
--- sites/default/default.settings.php	20 Dec 2007 09:35:10 -0000	1.8
+++ sites/default/default.settings.php	18 Feb 2008 18:30:07 -0000
@@ -184,6 +184,14 @@
  */
 #   'maintenance_theme' => 'minnelli',
 /**
+ * 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);
+/**
  * reverse_proxy accepts a boolean value.
  *
  * Enable this setting to determine the correct IP address of the remote
