note 54596 added to function.microtime
| From: | HelpfulHarry at osu1 dot php dot net | Date: | Fri, 08 Jul 2005 17:19:23 +0000 |
| Subject: | note 54596 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91690@lists.php.net to get a copy of this message | ||
eval script with microtime_float()
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="POST">
<textarea name="exec" rows="8" cols="60"><?php echo
htmlspecialchars($_POST['exec']); ?></textarea>
<br><br>
<input type="submit" value="Exec...">
</form>
<br>
<pre>
<?php
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
echo "--------------------------------------------------------\n\n";
$begin_timestamp = microtime_float();
eval(html_entity_decode($_POST['exec']));
$end_timestamp = microtime_float();
echo "\n\n--------------------------------------------------------\n";
echo '<b>Execution Time: '.($end_timestamp - $begin_timestamp).'
Seconds</b>';
}
?>
</pre>
</body>
</html>
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54596
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54596&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54596&report=yes
Search -- http://master.php.net/manage/user-notes.php