Asp Codes
ActiveX
ADO
Array
Code Snippets
Components
Data Access
Date Time
Files
Graphics
HTML Formatting
Mathematics
Miscellaneous
Sessions
SQL
Strings
Techniques
XML
Asp > Code Snippets sample source codes
Page load time
Page load time This simple script shows how to display the time it takes for a page to load . This is a feature which is used on several sites . The basic procedure is simple you just have 2 times one for when the page loads and one for when the page stops loading . You would place the start script at the top of the page and the end script at the bottom of the page. Here is the first script <% Dim starttime starttime = Timer %> this would be placed right at the top of your page . Now for the second part of the script this would be ideally be placed after any other scripts in your page , graphics , main content etc <% Dim endtime , timetaken endtime = Timer timetaken = FormatNumber(endtime - starttime , 4) Response.Write "This page took " & timetaken & "seconds to load" %> This simply subtracts the 2 times , formats them and displays the result on the page .
Privacy Policy
|
Link to Us
|
Links