Skip to content

Expose the CPU cycle counter via `\rdtsc()` to user-land using a php extension

License

Notifications You must be signed in to change notification settings

edorian/php-ext-rdtsc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-ffi-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

About

Expose the CPU cycle counter via `\rdtsc()` to user-land using a php extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published