本文整理匯總了PHP中Time::stop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Time::stop方法的具體用法?PHP Time::stop怎麽用?PHP Time::stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Time
的用法示例。
在下文中一共展示了Time::stop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testStop
public function testStop()
{
$driver = $this->buildMock();
$driver->expects($this->once())->method('measureTime')->with("foo");
$measurements = new Time("foo", $driver);
$measurements->stop();
}
示例2: test_collection
function test_collection($collection_url)
{
$collection = new Collection($collection_url);
// 獲取收藏夾名稱
$title = $collection->get_title();
var_dump($title);
// 獲取收藏夾簡介
$description = $collection->get_description();
var_dump($description);
// 獲取收藏夾建立者
$author = $collection->get_author();
var_dump($author);
$answer_list = $collection->get_answers();
foreach ($answer_list as $answer) {
var_dump($answer);
}
}
$time = new Time();
$time->star();
$user_url = 'https://www.zhihu.com/people/ahonn';
$question_url = 'https://www.zhihu.com/question/38813693';
$answer_url = 'https://www.zhihu.com/question/19550393/answer/12202130';
$topics_url = 'https://www.zhihu.com/topic/19552330';
$collection_url = 'https://www.zhihu.com/collection/19650606';
// test_user($user_url);
// test_question($question_url);
// test_answer($answer_url);
// test_topics($topics_url);
// test_collection($collection_url);
$time->stop();
echo $time->spent();