Brute force algorithm for square roots with tatics Programming Computer Science by cwarn23 …$j-=$m; $i=($j+$k); } } } return $i; } $s = microtime(true); mysq(128); $e = microtime(true); $a=($e-$s); unset($e,$s); sleep…(1); $s = microtime(true); sqrt(128); $e = microtime(true); echo 'mysq time   ='.$a.'<br>… Re: Brute force algorithm for square roots with tatics Programming Computer Science by cwarn23 …$i=($j+$k); } } } } return $i; } $s = microtime(true); mysq(128); $e = microtime(true); $a=($e-$s); unset($e,$s); sleep…(1); $s = microtime(true); sqrt(128); $e = microtime(true); echo 'mysq time   ='.rtrim(number_format($… Reflection vs Variable Variables Programming Web Development by jkon … { $this->id = $newId; } } //Variable variables way $startTime1 = microtime(true); $a = "testObj"; $method = "setId"; $test1…reflectionClass->getMethod($method); $reflectionMethod->invoke($test2,33); $endTime2 = microtime(true); echo "Reflection way: ".(number_format($endTime2 - $startTime2,… Insert Multiple Records with PDO Prepared Statement Programming Web Development by diafol …INTO members (firstname, surname, title) VALUES (?,?,?)'); $s = microtime(true); for($i=0;$i<count($data);$i++) {… $stmt->execute($data[$i]); } $e =microtime(true); echo ($e-$s); This test gave repeated results… Method $stmt->multiExecute($data); //New Method $e =microtime(true); echo ($e-$s); Using a couple of extended… Page creation is timed; sometimes comes up as negative? Programming Web Development by Mattshu …, I make a global variable and store the value of microtime() in it. The footer of the page is require()'d… separate footer page is a code that subtracts the current microtime() from said global variable, giving (what I thought to be… footer first because of the require(), THEN subtracting the actual microtime()? Or is this just a bug? Re: Page creation is timed; sometimes comes up as negative? Programming Web Development by diafol … to use the true flag to change microtime into a float: [CODE]$t = microtime(true); ... $s = microtime(true); echo "Time: " . (($s… Re: Insert Multiple Records with PDO Prepared Statement Programming Web Development by diafol …]; $data = array_fill(0, 1000, $d); //create 1000 identical members $s = microtime(true); $db = new PDO('mysql:host=localhost;dbname=journey','root…->execute($data[$i]); } $db->commit(); //**** ADD THIS $e =microtime(true); echo ($e-$s); Previously this took **over 3 seconds… Re: Page creation is timed; sometimes comes up as negative? Programming Web Development by Mattshu …-is: (inside index.php) [CODE] <?php global $timeToWrite; $timeToWrite = microtime(); ... ... ... require('pages/footer.php'); ... ?> [/CODE] (inside footer.php) [CODE…] ... ... <p>Page written in <?php echo microtime() - $timeToWrite; ?> seconds. ... [/CODE] My SQL Help :( Programming Databases by abz007 …"; } # MES elsif ($table eq $db_table_CAM) { use Time::HiRes; my $microtime = Time::HiRes::time; my $usec = sprintf("%.6f"…;, $microtime); $result->{"aid"} = ""; $result->{"… Php file upload Programming Web Development by rajeesh_rsn … making that file field is not mandatory ... [CODE]$string = md5(microtime() * mktime()); $new = substr($type,0,1); $ido = substr($string,0… keep trying until we find a vacant one $md5 = md5(microtime() * mktime()); $string = substr($md5,0,5); while(file_exists($uploadFilename = $uploadsDirectory… Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Programming Web Development by whizzell …;"; for($i=1; $i<=$length; $i++) { mt_srand((double)microtime() * 1000000); $num = mt_rand(1,36); $rand_id .= assign_rand_value($num); } }…;"; for($i=1; $i<=$length; $i++) { mt_srand((double)microtime() * 1000000); $num = mt_rand(27,36); $rand_id .= assign_rand_value($num); } } … Problem in cURL with HTTP POST Programming Web Development by hemgoyal_1990 … also time the transaction */ $start = array_sum(explode(' ', microtime())); $result = curl_exec($ch); $stop = array_sum(explode(' ', microtime())); $totalTime = $stop - $start; /** * Check for errors */ if… Re: Help a Newb here! Programming Web Development by darkagn ….net/manual/en/function.rand.php"]here[/URL]. By microtime, do you mean time to the microsecond? If so, …this can be achieved using the microtime function. [URL="http://www.php.net/manual/en/function….microtime.php"]Here[/URL] is a link to its documentation.… PHP sockets from remote host Programming Web Development by Kalphiter … ". $host .":". $port ."\n\n"); $beepExec = microtime(); $f = fopen("beepTime.txt", "w"); fwrite…); while(true) { if($beepExec != file_get_contents("beepTime.txt")) { $beepExec = microtime(); $f = fopen("beepTime.txt", "w"); fwrite… Re: Page creation is timed; sometimes comes up as negative? Programming Web Development by diafol … footer first because of the require(), THEN subtracting the actual microtime()? Or is this just a bug?[/B] Doubtful. Your php… Re: Page creation is timed; sometimes comes up as negative? Programming Web Development by Mattshu thanks ardav, for whatever reason, passing microtime() with 'true' fixed the random negative value. also, I guess I didn't need global, I think there was a reason for it but then I changed something and forgot about it. PHP MySQL problem Programming Web Development by mehnihma …implementation //////////////////////////////////////////// // Početak za timing skriptu za stranicu $time = microtime(); $time = explode(' ', $time); $time = $time[1]… fwrite($fh, csv2xml($fileNamPrefix.'.csv')); fclose($fh); $time = microtime(); $time = explode(' ', $time); $time = $time[… XML elements to csv Programming Web Development by mehnihma …); //delimiter define('DELIMITER','^'); $delimiter = '^'; function start_time(){ $time = microtime(); $time = explode(' ', $time); $time = $time[1]…$start = $time; return $start; } function duration_time($start){ $time = microtime(); $time = explode(' ', $time); $time = $time[1] + … progress bar problem Programming Web Development by kgizo …exporting the query <?php function connect_local_host() { $time_start = microtime(true); $mysqlserver = "localhost"; $user = "…$data"; //exit(); //} // progress bar code again $time_end = microtime(true); $time = $time_end - $time_start; $t_t=$time/$fields; $… PHP and JS Speed Calculation Programming Web Development by RazorRamon … it takes for the code to execute. <?php $before = microtime(true); /* A bunch of PHP Code */ ?> <!DOCTYPE html… Code </body> </html> <?php $after = microtime(true); echo ($after-$before); ?> Re: Forgot user password not updating user db Programming Web Development by accra …php page $password=mysql_real_escape_string($_POST['password']); $salt = uniqid(mt_rand()+microtime(true), true); $hpassword=hash('sha256',$password.$salt); // Encrypted password…is the one on my signup page $salt = uniqid(mt_rand()+microtime(true), true); $password=hash('sha256',$password.$salt); // Encrypted… How to activate user startpage functionality in custom CMS Programming Web Development by Benjamin Alexander …Segment[2], $Segment[3])); } function getMicroTime() { $T = explode(' ', microtime()); return ($T[0] + $T[1]); } ?> <? require_once…email'] == $_POST['email']) { $NewPass = substr(md5(implode('.', microtime()) . $User['email']), 2, 8); $email = file_get_contents('./templates/email… Login PhP Programming by ivay14 …set login to expire in 1 day srand((double) microtime() * 1000000); $encoded_login=encode_string($jobseeker_email_address."|"); @… clock for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); /* ini_set('error_reporting',E_ALL ^ E_NOTICE); ini_set('display_errors','1… Euhero Content locker script update Programming Web Development by menssouri83 …exit; // global $num_queries; // global $total_time; // $num_queries++; // $start_time = microtime(true); // echo "<br />".$num_queries." "…."</strong></p>"; // $time_taken = round(microtime(true) - $start_time, 4 ); // $total_time += $time_taken ; // if… Re: Php file upload Programming Web Development by wilch … keep trying until we find a vacant one $md5 = md5(microtime() * mktime()); $string = substr($md5,0,5); while(file_exists($uploadFilename = $uploadsDirectory… Re: Notice: A non well formed numeric value encountered in .. Programming Web Development by nanakumi75 The issue is solved now. I needed to cast the microtime(); as an integer. Like: PASSWORD_HASH($this->username,PASSWORD_DEFAULT + (int)microtime()); Problems using a php generator Programming Web Development by rwilkins … files can be uploaded</div>"; exit; } $n = microtime(); $n = str_replace(" ", "_", $n); $n = str_replace… Random text display with image, link Programming Web Development by Hjcooke … well. <?php $RANDOM_TXT_FILE = "sample_data.txt"; srand((double)microtime()*1000000); if (file_exists($RANDOM_TXT_FILE)) { $arry_txt = preg_split("/--NEXT--/", join… Re: Random text display with image, link Programming Web Development by paradox814 ….txt"; if (file_exists($RANDOM_TXT_FILE)) { $file = file($RANDOM_TXT_FILE); srand((double)microtime()*1000000); $random_line = rand(0,sizeOf($file)); echo $file[$random_line]; } //else… Re: Random text display with image, link Programming Web Development by paradox814 ….txt"; if (@file_exists($RANDOM_TXT_FILE)) { $file = @file($RANDOM_TXT_FILE); srand((double)microtime()*1000000); $random = 5 * rand(0, (int) (sizeOf($file)/5)); unset…