mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
`g++ -std=c++11 -lpthread src/hardware-counter.cpp
src/thread-local.cpp src/test.cpp` works and runs where `src/test.cpp` is:
```
int main() {
bool enable = true;
std::string events = "";
bool recordSubprocesses = false;
HPHP::HardwareCounter::Init(enable, events, recordSubprocesses);
HPHP::HardwareCounter::s_counter.getCheck();
int64_t start = HPHP::HardwareCounter::GetInstructionCount();
volatile int x;
for (int i = 0; i < 1000000; i++) {
x += i;
}
int64_t end = HPHP::HardwareCounter::GetInstructionCount();
printf("%d\n", end - start);
}
```