控制网页响应时间
Global.asax中
void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码
System.Timers.Timer timer = new System.Timers.Timer();
timer.Interval = 100;
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Enabled = true;
timer.Start();
}
void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Application.Lock();
Application["a"] = "hehe:" + DateTime.Now.ToString("mm:ss");
Application.UnLock();
}