2013-04-22 81 views
1

处理传统ASP应用程序的性能问题。追踪请求经典ASP中的处理时间

我想追踪请求开始时间和请求结束时间,就像我们在ASP.Net应用程序的global.asax.cs文件的BeginRequest和EndRequest或使用某个HTTPModule中所做的那样。

有没有办法在IIS下运行IIS应用程序可以执行相同的操作吗?

回答

0

您可以使用vbScript的Timer()函数获得近似值。此函数返回自上午12:00起的秒数和毫秒数。如果你真的想要测量高性能操作,那么粒度就会有所不同,但对于日常使用我已经取得了一些成功。

你可以使用该函数是这样的:

Option Explicit 

Dim startTime 
Dim executionTime 

startTime = Timer() 
' Do some stuff here that takes a while....' 
executionTime = Timer() - startTime 

Response.Write "Execution time: " & executionTime