Jump to content

Recommended Posts

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

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.

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....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.