You are here

function _feedapi_update_rate in FeedAPI 6

Same name and namespace in other branches
  1. 5 feedapi.module \_feedapi_update_rate()

Calculate the average between-update time

1 call to _feedapi_update_rate()
feedapi_admin_overview in ./feedapi.admin.inc
Provide a UI for overviewing the existing feeds

File

./feedapi.module, line 1506
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function _feedapi_update_rate($update_times) {
  $between = array();
  for ($i = 0; $i < count($update_times) - 1; $i++) {
    $between[] = abs($update_times[$i] - $update_times[$i + 1]);
  }
  return count($between) > 0 ? round(array_sum($between) / count($between), 2) : t('No data yet');
}