abhinavsingh89 Posted November 25, 2010 Share Posted November 25, 2010 I am currently working on a research based project and I need to know the processing time and pre- processing time for executing an query through PHP. I have a database which has several thousand values and i am entering a primary key value to fetch a record. Now i need to know the time before executing the query that how much processing time will the query take and then how much time it took to process query. Both will the same but i need to find the time before processing the query. Can anyone help me with that?? For processing time i think i will capture the time before executing the query and after execution, then i will subtract both the times to find out the processing time.. but main thing is i need to find this time before executing the query... so can anyone suggest anything... any help is appreciated... Thanking You, Abhinav Quote Link to comment https://forums.phpfreaks.com/topic/219837-prcocessing-time-and-pre-processing-time/ Share on other sites More sharing options...
jim_keller Posted November 25, 2010 Share Posted November 25, 2010 You should be able to use the microtime() function to get a timestamp in microseconds (and store it in a variable), run your query, then call microtime() again. Subtracting the two will give you the number of microseconds it took for PHP to run your query. Quote Link to comment https://forums.phpfreaks.com/topic/219837-prcocessing-time-and-pre-processing-time/#findComment-1139601 Share on other sites More sharing options...
abhinavsingh89 Posted November 26, 2010 Author Share Posted November 26, 2010 got it... this will work for processing time but i need to know this time before even executing the query.. i mean i need to know this time before processing (pre processing time).. and thanx for the microtime() function i will use it to find the processing time.... Quote Link to comment https://forums.phpfreaks.com/topic/219837-prcocessing-time-and-pre-processing-time/#findComment-1139830 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.