I’m using PDO, is there any way, to measure how long does it take to complete the query?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use microtime(true) to get the seconds needed to execute:
To get a more accurate time you should do that test more times (10000 here):
@Baz1nga, that code doesn’t work, since microtime_float() isn’t a function (Sorry, I can’t comment, need more reputation :()