Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Time ASP Execution

Posted on July 30, 2013October 26, 2015 By David Kittell
' get timer before task begins:
starttime = Timer()

' do some task, e.g.:
Do While z < 350000
z = z + 1
Loop

' get timer after task completes:
endtime = Timer()

' display results:
Response.Write "The task completed in " & endtime-starttime & " s"
Response.Write " (" & (endtime-starttime)*1000 & " milliseconds)."
' set number of seconds:
numSeconds = 5

' set counter:
counter = 0

' get starttime:
starttime = now()

' set endtime to some time more than numSeconds in the future:
endtime = dateadd("n", numseconds + 1, starttime)

' loop until numSeconds have passed, resetting endtime each loop:
Do Until DateDiff("s", starttime, endtime) = numSeconds
endtime = Now()
counter = counter + 1
Loop

' display results:
Response.Write "In " & numSeconds & " seconds, the task completed " & counter & " times."
Response.Write "<br>(Average time per loop: "
Response.Write FormatNumber(numSeconds*1000/counter,0,-1,0,-1) & " milliseconds.)"

Source: http://classicasp.aspfaq.com/general/how-do-i-time-my-asp-code.html

Originally Posted on July 30, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

ASP Code VB

Post navigation

Previous post
Next post

Related Posts

Swift – iOS – GPS – Coordinates – Lat/Long to DMS

Posted on June 8, 2018

If you have a need for displaying the GPS location information in Degrees, minutes, and seconds (DMS) format these functions will help you out. func latlon2DMS(latitude: Double) -> String { var latitudeSeconds = latitude * 3600 let latitudeDegrees = latitudeSeconds / 3600 latitudeSeconds = latitudeSeconds.truncatingRemainder(dividingBy: 3600) let latitudeMinutes = latitudeSeconds…

Read More

MSSQL Table Backup Script

Posted on August 20, 2015October 26, 2015

This is a quick way to backup table structure and data, this will go out to the system table and query all tables then provide a script to recreate the tables. SELECT ‘create table [’ + so.NAME + ‘] (‘ + o.list + ‘)’ + CASE WHEN tc.Constraint_Name IS NULL…

Read More

Clone A Menu Into Multiple Languages

Posted on October 23, 2013October 26, 2015

BEGIN TRANSACTION CREATE TABLE #NewMenu ( [mnu_id] [bigint] NOT NULL ,[mnu_name] [nvarchar](255) NULL ,[mnu_description] [nvarchar](255) NULL ,[folder_id] [bigint] NOT NULL ,[recursive] [int] NOT NULL ,[user_id] [bigint] NULL ,[date_created] [datetime] NOT NULL ,[last_edit_date] [datetime] NULL ,[last_edit_lname] [nvarchar](50) NOT NULL ,[last_edit_fname] [nvarchar](50) NOT NULL ,[mnu_type] [int] NOT NULL ,[mnu_link] [nvarchar](255) NULL ,[template_link]…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes