本文整理汇总了PHP中Host::read_cpu_time_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Host::read_cpu_time_file方法的具体用法?PHP Host::read_cpu_time_file怎么用?PHP Host::read_cpu_time_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host::read_cpu_time_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Work
$project->install();
// must install projects before adding to hosts
$host->log_flags = "log_flags.xml";
$host->add_project($project);
$host->install();
echo "adding work\n";
$work = new Work($app);
$work->wu_template = "uccpu_wu";
$work->result_template = "uccpu_result";
$work->redundancy = 1;
array_push($work->input_files, "small_input");
$work->install($project);
$project->start_feeder();
$app_time = 0;
$host->run("-exit_after_app_start 400");
$app_time += $host->read_cpu_time_file("app.time");
$host->run("-exit_when_idle");
$project->stop();
$result->server_state = RESULT_SERVER_STATE_OVER;
$project->check_results(1, $result);
$project->compare_file("uccpu_wu_0_0", "uc_small_correct_output");
$client_time = $host->read_cpu_time_file("client_time");
$x = mysql_query("select cpu_time from result where name='uccpu_wu_0'");
$result = mysql_fetch_object($x);
$db_time = $result->cpu_time;
if (abs($app_time - $client_time) > 0.01) {
echo "time mismatch\n";
}
if (abs($app_time - $db_time) > 0.01) {
echo "time mismatch\n";
}