Skip to content

beberlei/php-compiletime-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compiletime

Running benchmarks of complex PHP code on the CLI? The numbers are lying to you. Even with opcache.enable_cli=1 you will have compilation times of the files in timings. With this extension you can have access how much milliseconds the current PHP script has spent in compiling (not executing) code.

Installation

phpize
./configure
make
sudo make install
echo 'extension=compiletime.so' > /path/to/php.ini.d/compiletime.ini

Usage

Extension exposes one simple function:

/**
 * Returns the current time spent in compiling since the beginning of script.
 */
function compiletime_get_current() : int

Substracting two compile time durations allows to compute the time compiling between those calls.

License: MIT

About

Extension that counts the time spent in PHP file compilation during the execution of a script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published