none
my timer is behaving lazzyly(delaying)

    Question

  • please some one help me .

    my app hase a timer in quiz.

    but each time a event occure than timer start with a delay of approx. 2 seconds. hear is code :-             public Quiz()
            {

                time.Interval = new TimeSpan(10000000);
                time.Tick += time_Tick;
                timestart();


            }
            public void timestart()
            {
                dtTime = dtTime.AddSeconds(-dtTime.Second);
                dtTime = dtTime.AddSeconds(31);
                time.Start();
            }
            DateTime dtTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, 12, 0, 31);

            void time_Tick(object sender, object e)
            {
                if (dtTime.Second > 0)
                {
                    dtTime = dtTime.AddSeconds(-1);
                    Timer.Text = dtTime.ToString("mm:ss");
                }
                else
                {
                    time.Stop();
                    Button_next.Visibility = Visibility.Visible;
                }
            }


    Thursday, January 24, 2013 9:51 AM

Answers

All replies