Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.11 KB

File metadata and controls

30 lines (21 loc) · 1.11 KB

php-ext-rdtsc

Expose the __rdtsc CPU cycle counter to user-land using a php extension

Requirements

  • x64 platform
  • gcc

Usage

phpize
./configure
make
php -d extension=modules/rdtsc.so example.php

Notes

Given the various caveats with __rdtsc this should be used with great care when trying to measure things.

There also is a PHP-FFI implementation that provides the same functionality available.

For most cases getrusage() should be preferable.

References