當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Scheduler::debug方法代碼示例

本文整理匯總了PHP中Scheduler::debug方法的典型用法代碼示例。如果您正苦於以下問題:PHP Scheduler::debug方法的具體用法?PHP Scheduler::debug怎麽用?PHP Scheduler::debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Scheduler的用法示例。


在下文中一共展示了Scheduler::debug方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

} elseif ($race == Zerg) {
    Hatcheries::$debug = (bool) ($debugFlags & Hatcheries::debugFlag);
    $timeline->hatcheries->add(new Hatchery(0, 3));
    $timeline->farms->add(new Farm(0, $Hatchery->supplyCapacity));
    $timeline->farms->add(new Farm(0, $Overlord->supplyCapacity));
    //$timeline->queues->add(new ProductionQueue($Hatchery));
}
$timeline->queues->add(new ProductionQueue(Product::designated($race | Base)));
$timeline->supplyCount = 6;
// create recurring worker job
$job = new BuildJob(Product::designated($race | Worker));
$job->recurring = true;
$unscheduledJobs[] = $job;
// schedule jobs
$scheduler = new Scheduler($timeline, $unscheduledJobs);
Scheduler::$debug = (bool) ($debugFlags & Scheduler::debugFlag);
$scheduledJobs = $scheduler->schedule();
// render timeline
echo (string) $timeline;
// render queues
$timeEnds = 0;
foreach ($scheduledJobs as $job) {
    $timeEnds = max($timeEnds, $job->timeCompleted);
}
?>
<h3>Usage of production queues</h3>
<p>This table shows the busy time of your production queues. Production queues which remain completely unused are not shown. A production queue is considered <i>destroyed</i> when the structure is morphed into another structure, such as a Warpgate or Orbital Command.</p>
<p>The timeline ends at <?php 
echo simple_time($timeEnds);
?>
.</p>
開發者ID:iceeyhot,項目名稱:sc2calc.org,代碼行數:31,代碼來源:update.php


注:本文中的Scheduler::debug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。