| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * Link : http://www.phpcorner.net
- * User : qingbing<780042175@qq.com>
- * Date : 2018-10-28
- * Version : 1.0
- */
- namespace Test;
- use Helper\Timer;
- use TestCore\Tester;
- class TestTimer extends Tester
- {
- /**
- * 执行函数
- * @throws \Helper\Exception
- */
- public function run()
- {
- // 获取当前的时间戳,时间格式,最多6为小数
- $timestamp = Timer::microTime();
- var_dump($timestamp);
- // 获取当前的时间戳,浮点格式,最多6为小数
- $timestamp = Timer::microTime(false);
- var_dump($timestamp);
- /**
- * timer 时间栈的用法
- */
- // 开始
- Timer::begin('app');
- // coding here.
- $much = Timer::end('app');
- var_dump($much);
- }
- }
|