You need to determine the execution time of a query being returned from a CFC, function or tag.
Use the getMetaData() on a query object to get access to its "result" structure.
ColdFusion supports a
result attribute in the
<cfquery /> tag for returning a structure
containing execution time, the SQL statement, record count, etc.
However, when your query object is being returned from a CFC,
function or tag you may not have the ability to utilize the
result attribute.
However, you can get access to this same information by using
the
getMetaData() method on the query object:
<cfdump var="#queryName.getMetaData().getExtendedMetaData()#" />
This will output the basic
information that's normally available via the
<cfquery /> tag's
result attribute.
This means you can output the execution time of any query object that originated from a SQL statement using the following:
<cfoutput>
#numberFormat(max(queryName.getMetaData().getExtendedMetaData().executionTime, 1)/1000, "0.000")# seconds
</cfoutput>
+