控制网页响应时间

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();
    }

posted @ 2009-05-15 15:43  杨子宜  阅读(229)  评论(0编辑  收藏  举报