note 69705 added to function.microtime

From: Date: Sat, 16 Sep 2006 17:00:21 +0000
Subject: note 69705 added to function.microtime
Groups: php.notes 
Request: Send a blank email to php-notes+get-117244@lists.php.net to get a copy of this message
this is the function i use instead of microtime() with php < 5. it returns the whole time (seconds and microseconds) as a string or as a float. <?php function myMicrotime($get_as_float = false) { list($msec, $sec) = explode(" ", microtime()); $time = $sec . substr($msec, 1); return $as_float === false ? $time : (float)$time; } ?> ---- Server IP: 66.163.161.117 Probable Submitter: 62.46.212.56 ---- Manual Page -- http://www.php.net/manual/en/function.microtime.php Edit -- https://master.php.net/note/edit/69705 Del: integrated -- https://master.php.net/note/delete/69705/integrated Del: useless -- https://master.php.net/note/delete/69705/useless Del: bad code -- https://master.php.net/note/delete/69705/bad+code Del: spam -- https://master.php.net/note/delete/69705/spam Del: non-english -- https://master.php.net/note/delete/69705/non-english Del: in docs -- https://master.php.net/note/delete/69705/in+docs Del: other reasons-- https://master.php.net/note/delete/69705 Reject -- https://master.php.net/note/reject/69705 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117244) next »