RE: [PHP] Problem with microtime()

From: Date: Fri, 31 Aug 2001 07:42:58 +0000
Subject: RE: [PHP] Problem with microtime()
Groups: php.general 
Request: Send a blank email to php-general+get-65424@lists.php.net to get a copy of this message
You are casting microtimes results as an integer value. It isn't an integer value, hence the 0. From the manual It returns the string the string "msec sec" where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This function is only available on operating systems that support the gettimeofday() system call. Try: for ($i = 0; $i < 100; $i++) { $k = microtime(); echo "<br>$k"; for ($j = 0; $j < 10000; $j++) $m = $j *3; } Or look in the http://www.php.net/manual/en/function.microtime.php for examples. -----Original Message----- From: Rosen [mailto:rosen_dm@dir.bg] Sent: August 31, 2001 3:29 PM To: php-general@lists.php.net Subject: [PHP] Problem with microtime() Hi, I'm using the following code: for ($i = 0; $i < 100; $i++) { $k = (int) microtime(); echo "<br>$k"; for ($j = 0; $j < 10000; $j++) $m = $j *3; } but it prints me only "0......" Where can be problem ? Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#65424) next »