![]() |
|
|
Timing retrieval of database records using Timer FunctionThe code snippet below places the Timer function at the start of our code and at the end of our code and assigns the seconds returned to variables. Subtracting the StartTime from the EndTime variable will give us the time it takes to execute our code. <%@ Language="VBScript" %> StartTime = Timer 'define the connection string, specify database 'create an ADO connection and recordset 'Open the connection to the database 'Open the recordset object, execute the SQL statement 'first of all determine whether there are any records 'close the connection and recordset objects and free up resources EndTime = Timer </body> If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site. Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|