1

处理经典 ASP 应用程序的性能问题。

我想跟踪请求开始时间和请求结束时间,例如我们如何在 ASP.Net 应用程序的 global.asax.cs 文件的 BeginRequest 和 EndRequest 中执行此操作或使用一些 HTTPModule。

有没有办法在 IIS 下运行的 asp 应用程序可以实现一样?

4

1 回答 1

0

您可以使用 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
于 2013-04-22T17:28:01.167 回答