29 lines
763 B
PHP
29 lines
763 B
PHP
|
<?php
|
||
|
|
||
|
require_once __DIR__."/../vendor/autoload.php";
|
||
|
|
||
|
use NoccyLabs\Spinner\Spinner;
|
||
|
|
||
|
// Create three spinners with various refresh rates...
|
||
|
$spinner1 = new Spinner(fps:5);
|
||
|
$spinner2 = new Spinner(fps:10);
|
||
|
$spinner3 = new Spinner(fps:20);
|
||
|
|
||
|
Spinner::setDefaultStyle(NoccyLabs\Spinner\Style\RollingBallStyle::class);
|
||
|
$spinner4 = new Spinner(fps:5);
|
||
|
$spinner5 = new Spinner(fps:10);
|
||
|
$spinner6 = new Spinner(fps:20);
|
||
|
|
||
|
Spinner::setDefaultStyle(NoccyLabs\Spinner\Style\SpinnerStyle::class);
|
||
|
$spinner7 = new Spinner(fps:5);
|
||
|
$spinner8 = new Spinner(fps:10);
|
||
|
$spinner9 = new Spinner(fps:20);
|
||
|
|
||
|
|
||
|
// And blast them out every 10ms!
|
||
|
while(true) {
|
||
|
echo "\r $spinner1 $spinner2 $spinner3 $spinner4 $spinner5 $spinner6 $spinner7 $spinner8 $spinner9 ";
|
||
|
usleep(10000);
|
||
|
}
|
||
|
|