PHP code example of zkrat / while-timer

1. Go to this page and download the library: Download zkrat/while-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/ */

    

zkrat / while-timer example snippets


do{
	echo 'Hello Word:  every 100 milliseconds ('.\zkrat\WhileTimer::getCounter().')'.PHP_EOL;
}while(\zkrat\WhileTimer::sleep(2,0.1));
//==========================================
while(\zkrat\WhileTimer::sleep(2,0.1)){
	echo 'Hello Word:  every 100 milliseconds ('.\zkrat\WhileTimer::getCounter().')'.PHP_EOL;
};


do{
	echo 'Hello Word each 1 second ('.\zkrat\WhileTimer::getCounter().')'.PHP_EOL;
}while(\zkrat\WhileTimer::sleep(6,1));

do{
	echo 'Hello Word each 0.5 seconds ('.\zkrat\WhileTimer::getCounter().')'.PHP_EOL;
}while(\zkrat\WhileTimer::usleep(3000000,500000));