[Mono-bugs] [Bug 418107] New: Timer fires too agressively

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 18 14:33:15 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=418107


           Summary: Timer fires too agressively
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The Tick event of System.Windows.Forms.Timer apparently fires twice whenever
the interval elapses.

Note:
This only affects Windows.

To reproduce, compile and run the following code:

using System;
using System.Windows.Forms;

public class MainForm : Form
{
        public MainForm ()
        {
                // 
                // _timer
                // 
                _timer = new Timer ();
                _timer.Interval = 1000 * 2; // update every 2 seconds
                _timer.Tick += new EventHandler (Timer_Tick);
                _timer.Start ();
        }

        [STAThread]
        static void Main ()
        {
                Application.Run (new MainForm ());
        }

        static void Timer_Tick (object sender, EventArgs e)
        {
                Console.WriteLine ("TICK");
        }

        private Timer _timer;
}

Expected result:

one "TICK" line is written to the console every 2 seconds.

Actual result:

two "TICK" lines are written to the console every 2 seconds.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list