【问题标题】:Tracing Request Process time in classic ASP在经典 ASP 中跟踪请求处理时间
【发布时间】:2013-04-22 12:06:56
【问题描述】:
处理经典 ASP 应用程序的性能问题。
我想跟踪请求开始时间和请求结束时间,比如我们如何在 ASP.Net 应用程序的 global.asax.cs 文件的 BeginRequest 和 EndRequest 中执行此操作,或者使用一些 HTTPModule。
有没有办法在 IIS 下运行的 asp 应用程序可以实现同样的功能?
【问题讨论】:
标签:
asp.net
performance
iis
iis-7
asp-classic
【解决方案1】:
您可以使用 vbScript 的 Timer() 函数获得近似值。此函数返回自 12:00 AM 以来的秒数和毫秒数。如果您真的想测量高性能操作,那么粒度还有待改进,但对于日常使用,我已经取得了一些成功。
你可以像这样使用函数:
Option Explicit
Dim startTime
Dim executionTime
startTime = Timer()
' Do some stuff here that takes a while....'
executionTime = Timer() - startTime
Response.Write "Execution time: " & executionTime