php-linux-cpu/examples/cpuinfo.php

15 lines
476 B
PHP
Raw Normal View History

2015-01-23 03:21:07 +00:00
<?php
require_once __DIR__."/../vendor/autoload.php";
use NoccyLabs\Linux\Cpu\Cpu;
$cpu = new Cpu();
printf("Number of CPUs/cores: %d\n", $cpu->getNumCpus());
printf("Current governor: %s\n", $cpu->getCurrentGovernor());
printf("Available governors: %s\n", join(", ", $cpu->getAvailableGovernors()));
printf("Current frequency: %d\n", $cpu->getCurrentFrequency());
printf("Available frequencies: %s\n", join(", ", $cpu->getAvailableFrequencies()));