i have a script which executes several queries for n number of records.How can is set the time in that to know how much time each query took to run
i have a script which executes several queries for n number of records.
Collapse
X
-
Tags: None
-
A simple easy way is to declare a start time variable before the query and an end time variable after the query has run. The difference between the two will give you the duration.
Code:<?php $time_start = microtime(true); // Query here mysql_query(); $time_end = microtime(true); $time = $time_end - $time_start; echo "Did nothing in $time seconds\n"; ?>
Comment