Created
April 17, 2016 04:28
-
-
Save mgttt/af429dba0015b5ba57c3d16dd1f46c49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test loading time of php, and Result: | |
# php5.5/macos(come with apache bundle)/-opcache: around 120 ms | |
# php70/+opcache/macos(brew): | |
# case 1, php -r, around 15ms | |
# case 2, php test_php_launch_time.php, around 18-20ms | |
nano=`date +%N` | |
echo nano=$nano | |
if [ "$nano" == "N" ]; | |
then | |
#echo " date +%N not working, please [brew install coreutils] and run [gdate] instead " | |
echo "WARNING: date +%N not working, trying use gdate ( brew install coreutils && gdate ): " | |
date="gdate" | |
fi | |
mytime=`$date +%s.%N` | |
echo mytime=$mytime | |
php -r "\$php_micro_time=microtime(true);\$sys_micro_time=\$argv[1];print \$php_micro_time.\"\\n\".\$sys_micro_time.\"\\n\";" $mytime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment