trace.php 979 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of the Fidry CPUCounter Config package.
  5. *
  6. * (c) Théo FIDRY <theo.fidry@gmail.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. declare(strict_types=1);
  12. use Fidry\CpuCoreCounter\CpuCoreCounter;
  13. use Fidry\CpuCoreCounter\Finder\FinderRegistry;
  14. require_once __DIR__.'/../vendor/autoload.php';
  15. $separator = str_repeat('–', 80);
  16. echo 'With all finders...'.PHP_EOL.PHP_EOL;
  17. echo (new CpuCoreCounter(FinderRegistry::getAllVariants()))->trace().PHP_EOL;
  18. echo $separator.PHP_EOL.PHP_EOL;
  19. echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL;
  20. echo (new CpuCoreCounter(FinderRegistry::getDefaultLogicalFinders()))->trace().PHP_EOL;
  21. echo $separator.PHP_EOL.PHP_EOL;
  22. echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL;
  23. echo (new CpuCoreCounter(FinderRegistry::getDefaultPhysicalFinders()))->trace().PHP_EOL;
  24. echo $separator.PHP_EOL.PHP_EOL;