In the development process, you often want to improve performance. In Web development, the page execution time is a very important performance parameter. BOSS often complains that a page is very slow, although it has made a lot of optimization, access is slowly probably the network problem However, there must be a quantified data of persuasive, and the aspx can't get execution time as ASP. Is there any good way to wait until the ASPX page execution time? After a period of exploration, I finally found a full solution: 1. Add a class in the project, it is called the pageelapse.cs code as follows (the sample code of the Microsoft PM & A2K lecture): use system; using system.Web Download Adobe Reader: USING SYSTEM
Namespace Common {///
Public void init (system.web.httpApplication context) {context.beginRequest = new eventhandler (OnBeginRequest); context.endrequest = new eventhandler
Public void dispose () {}
Private void OnbeginRequest (Object Sender, Eventargs E) {_StartTime = DateTime.now;
Private void OneundRequest (Object Sender, Eventargs E) {Timespan Ts = DateTime.now - _StartTime;
HttpContext.current.response.write ("