Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

How to get the execution time of a MySQL query from PHP? -


this question has answer here:

i execute mysql queries php , know how time consuming are. there way execution time of mysql query php?

i wonder if execution time depends on how loaded web server. can imagine query take more time execute if server busy other queries. on other hand, can imagine that, if server busy, query wait turn , executed (without queries executed in parallel) , waiting time not included execution time. so, scenarios (out of two) correct?

there way via mysql, however, easy (and reliable) way using php's microtime function, returns current time milliseconds.

microtime() returns current unix timestamp microseconds. function > available on operating systems support gettimeofday() system call.

getasfloat - when called without optional argument, function returns string "msec sec" sec current time measured in number of seconds since unix epoch (0:00:00 january 1, 1970 gmt), , msec microseconds part. both portions of string returned in units of seconds.

if optional get_as_float set true float (in seconds) returned.

some example code:

$sql = '...'; $msc = microtime(true); mysql_query($sql); $msc = microtime(true)-$msc; echo $msc . ' s'; // in seconds echo ($msc * 1000) . ' ms'; // in millseconds 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -