? translations
Index: simplenews.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.admin.inc,v
retrieving revision 1.49
diff -u -p -r1.49 simplenews.admin.inc
--- simplenews.admin.inc	12 Jan 2009 19:35:59 -0000	1.49
+++ simplenews.admin.inc	18 Jan 2009 16:16:40 -0000
@@ -890,13 +890,18 @@ function simplenews_admin_settings_mail(
   );
   $throttle = drupal_map_assoc(array(1, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000));
   $throttle[999999] = t('Unlimited');
+  if (function_exists('getrusage')) {
+    $description_extra = '<br />'. t('Cron execution must not exceed the PHP maximum execution time of %max seconds. You find the time spend to send emails in the <a href="/admin/reports/dblog">Recent log entries</a>.', array('%max' => ini_get('max_execution_time')));
+  }
+  else {
+    $description_extra = '<br />'. t('Cron execution must not exceed the PHP maximum execution time of %max seconds.', array('%max' => ini_get('max_execution_time')));
+  }
   $form['simplenews_mail_backend']['simplenews_throttle'] = array(
     '#type' => 'select',
     '#title' => t('Cron throttle'),
     '#options' => $throttle,
     '#default_value' => variable_get('simplenews_throttle', 20),
-    '#description' => t('Sets the numbers of newsletters sent per cron run. Failure to send will also be counted.') .'<br />'.
-      t('Cron execution must not exceed the PHP maximum execution time of %max seconds. You find the time spend to send emails in the <a href="/admin/reports/dblog">Recent log entries</a>.', array('%max' => ini_get('max_execution_time'))),
+    '#description' => t('Sets the numbers of newsletters sent per cron run. Failure to send will also be counted.') . $description_extra,
   );
   $form['simplenews_mail_backend']['simplenews_spool_expire'] = array(
     '#type' => 'select',
Index: simplenews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.module,v
retrieving revision 1.196
diff -u -p -r1.196 simplenews.module
--- simplenews.module	15 Jan 2009 19:57:08 -0000	1.196
+++ simplenews.module	18 Jan 2009 16:16:43 -0000
@@ -1717,8 +1717,14 @@ function simplenews_mail_spool($nid = NU
     }
     simplenews_send_status_update();
 
-    // Report sent result and elapsed time
-    watchdog('simplenews', '%count emails sent in %sec seconds.', array('%count' => count($mail_sent), '%sec' => round(_simplenews_measure_usec(), 1)));
+    // Report sent result and elapsed time. On Windows systems retrusage() is
+    // not implemented and hence no elapsed time is available.
+    if (function_exists('getrusage')) {
+      watchdog('simplenews', '%count emails sent in %sec seconds.', array('%count' => count($mail_sent), '%sec' => round(_simplenews_measure_usec(), 1)));
+    }
+    else {
+      watchdog('simplenews', '%count emails sent.', array('%count' => count($mail_sent)));
+    }
   }
 }
 
@@ -2249,6 +2255,11 @@ function _simplenews_subscription_confir
  * @return float: elapsed PHP execution time since start.
  */
 function _simplenews_measure_usec($start = FALSE) {
+  // Windows systems don't implement getrusage(). There is no alternative.
+  if (!function_exists('getrusage')) {
+    return 0;
+  }
+  
   static $start_time;
   $usage = getrusage();
   $now = (float)($dat["ru_stime.tv_sec"] .'.'. $dat["ru_stime.tv_usec"]) + (float)($usage["ru_utime.tv_sec"] .'.'. $usage["ru_utime.tv_usec"]);
