run(1000, 0, true, true);
foreach($results as $filter_id => $result) {
$time += $result['time'];
$count += $result['count'];
$total += $result['total'];
$error[] = $result['error'];
//echo "Processed filter (ID): $filter_id, average: $result[time] s., find count: $result[count] from total: $result[total]" . "
";
}
//if (!empty($error)) {
// file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/telegramm_error_new.log',
// date('Y-m-d H:i:s') . " - errors: " . json_encode($error, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL,
// FILE_APPEND | LOCK_EX
// );
//}
//echo "Summary average: $time s., summary count: $count from total: $total" . "
";
//if (!empty($error)) {
// echo "Errors: " . var_export($error, true);
//}