本文整理汇总了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();