PHP code example of hcg / run-timer

1. Go to this page and download the library: Download hcg/run-timer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hcg / run-timer example snippets

`

use Hcg\RunTimer\RunTimer as RunTimer;

// 实例化
$timer = new RunTimer();
$timer->start();

# 需要执行的代码,我们这里简单的睡眠2秒,代表程序执行花费了2秒
sleep(2);

$timer->stop();
$timer->echo();