Re: Script's length, echo, and execution speed

From: Date: Sat, 23 Dec 2006 21:39:10 +0000
Subject: Re: Script's length, echo, and execution speed
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-246180@lists.php.net to get a copy of this message
Casey Chu wrote: > > Yeah, try testing. Maybe something like this: > <?php > $form = "<form action=' ' method='post'><textarea > name='code'></textarea><br /><button > type='submit'>Execute</button></form>"; > if ($_POST['code']) { > echo "<div style='border: 1px'>"; > $time_start = microtime_float(); > eval($_POST['code']); > $time_end = microtime_float(); > echo "<br />Loading took: ". $time_end - $time_start. > '</div>'; > } > echo "<div style='float: left'>$form</div>"; > // Note: This script is extremely dangerous and is not tested. > ?> > > under php5 use can use microtime(1) for timestamps -- View this message in context: http://www.nabble.com/Script%27s-length%2C-echo%2C-and-execution-speed-tf2875055.html#a8037132 Sent from the PHP - General mailing list archive at Nabble.com.

« previous php.general (#246180) next »