initial commit

This commit is contained in:
Carl Pearson
2019-09-19 10:59:28 -05:00
parent a8a014e706
commit f51ef904fb
18 changed files with 572 additions and 0 deletions

26
examples/os_perf.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include "perfect/os_perf.hpp"
#include <map>
int main(void) {
std::map<int, perfect::OsPerfState> states;
for (auto cpu : perfect::cpus()) {
perfect::OsPerfState state;
perfect::get_os_perf_state(&state, cpu);
states[cpu] = state;
perfect::os_perf_state_maximum(cpu);
}
// do things with all CPUs set to the maximum performancem mode by the OS
for (auto kv : states) {
int cpu = kv.first;
perfect::OsPerfState state = kv.second;
perfect::set_os_perf_state(cpu, state);
}
}