コード例 #1
0
ファイル: function.member.php プロジェクト: edmundwong/V604
function get_show_arr($now_get, $success_count, $get_count, $all_get_time = 0, $end = 1)
{
    $pro = ceil(100 * ($success_count / $get_count));
    if ($pro == 101 || $pro > 101) {
        return FALSE;
    }
    if ($end == 1) {
        $get_time = d_e(0);
    }
    $all_get_time += $get_time;
    $avg_get_time = $success_count > 0 ? $all_get_time / $success_count : 0;
    $wait_count = $get_count - $success_count;
    $wait_time = $avg_get_time * $wait_count;
    if (function_exists('php_set')) {
        $memory = 100 * (get_memory() / php_set('memory_limit'));
        $memory = $memory || $memory != 0 ? sprintf('%.0f%%', $memory) : milu_lang('un_know');
    }
    $show_arr = array('pro' => $pro, 'wait_time' => $wait_time, 'memory' => $memory, 'wait_count' => $wait_count, 'now' => $now_get, 'all_get_time' => $all_get_time);
    return $show_arr;
}
コード例 #2
0
ファイル: pick.class.php プロジェクト: edmundwong/V604
 function get_pick_status($end = 0)
 {
     $get_count = $this->get_pick_count();
     if ($end == 1) {
         $get_time = d_e(0, 'run');
         $this->all_get_time += $get_time;
         $this->pick_cache_data['all_get_time'] = $this->all_get_time;
     }
     if ($get_count) {
         $pro = ceil(100 * ($this->i / $get_count));
         if ($pro == 101 || $pro > 101) {
             return;
         }
         $avg_get_time = $this->all_get_time / $this->i;
         $wait_count = $get_count - $this->i;
         $wait_time = $avg_get_time * $wait_count;
     } else {
         $pro = $wait_time = $wait_count = milu_lang('un_know');
     }
     if (function_exists('php_set')) {
         $memory = 100 * (get_memory() / php_set('memory_limit'));
         $memory = $memory || $memory != 0 ? sprintf('%.0f%%', $memory) : milu_lang('un_know');
     }
     $wait_time = is_numeric($wait_time) ? round($wait_time) : $wait_time;
     $this->status_arr = array('pro' => $pro, 'wait_time' => $wait_time, 'memory' => $memory, 'wait_count' => $wait_count, 'now' => $this->i);
     $this->status_arr = array_merge($this->status_arr, $this->msg_args);
 }