This is my first post on SO. Usually just lurking, which helps me a lot. But I can't solve this one and need your help! I have made a test program using Windows Forms. It contains two buttons (a start and a stop button). When the start button is clicked, for every ms (millisecond), a log-function is being called, which extracts some basic information (or so I thought). The test stops after 2 minutes, where the stop function is clicked. When the test has been running for 2 minutes, there are only 7789 measurements. The test doesn't add up - any ideas, why is this so? I've attached a screenshot of the code of the start and stop buttons. enter image description here
//Start-button
private void button1_CLick(object sender, EventArgs e)
{
TestInitiated = true;
LogTimer = new System.Windows.Forms.Timer();
LogTimer.Tick += new EventHandler(stopwatch_tick);
LogTimer.Enabled = true;
LogTimer.Interval = 1;
LogTimer.Start();
}
//STop-Button
private void button2_Click)object sender, EventArgs e)
{
TestInitiated = false;
LogTimer.Stop();
LogTimer.Enabled = false;
}