Created
January 20, 2015 08:48
-
-
Save abhi-bit/afda95891ac46b3009ed 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
<?php | |
function microtime_float() | |
{ | |
list($usec, $sec) = explode(" ", microtime()); | |
return ((float)$usec + (float)$sec); | |
} | |
$starttime = microtime_float(); | |
$cb = new Couchbase("10.4.2.115:8091", "","","default", false); | |
$cb->set(uniqid('php_'), 1); | |
$endtime = microtime_float(); | |
$total_time = ($endtime - $starttime); | |
echo 'Total time for conn and set: '.$total_time.' secs'; | |
echo "\n"; | |
$i = 0; | |
for($i = 0; $i <= 100 ; $i++) | |
{ | |
$starttime = microtime_float(); | |
$cb->set(uniqid('php_'), 1); | |
$endtime = microtime_float(); | |
$total_time = ($endtime - $starttime); | |
echo 'Total time taken for'.$i.' set: '.$total_time.' secs'; | |
echo "\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment