Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.668
diff -u -F^f -r1.668 common.inc
--- includes/common.inc	1 Jul 2007 17:41:14 -0000	1.668
+++ includes/common.inc	1 Jul 2007 21:12:32 -0000
@@ -2346,8 +2346,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());
