Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:48:44+00:00 2026-05-22T18:48:44+00:00

I use two System.Windows.Forms.Timer objects in my project as below. private void Form1_Load(object sender,

  • 0

I use two System.Windows.Forms.Timer objects in my project as below.

private void Form1_Load(object sender, EventArgs e)
{
    timer1.Interval = 60000;
    timer2.Interval = 62000;
    timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
    Console.WriteLine("Timer1 :" + DateTime.Now.ToString());
    timer2.Start();
}

private void timer2_Tick(object sender, EventArgs e)
{  
    Console.WriteLine("Timer2 :" + DateTime.Now.ToString());
    timer2.Stop();
}

The output result is :

Timer1 :05/30/2011 12:15:57 AM      (12:16:59)
Timer1 :05/30/2011 12:16:57 AM      (12:17:59) miss
Timer2 :05/30/2011 12:16:59 AM      

Timer1 :05/30/2011 12:17:57 AM      (12:18:59)
Timer1 :05/30/2011 12:18:57 AM      (12:19:59) miss
Timer2 :05/30/2011 12:18:59 AM

Timer1 :05/30/2011 12:19:57 AM      (12:20:59)
Timer1 :05/30/2011 12:20:57 AM      (12:21:59) miss
Timer2 :05/30/2011 12:20:59 AM

I can’t understand why every second time of timer1 for timer2 is missing.

I mean Timer2 should start at 12:17:59 for Timer1 start at 12:16:57 AM.

How can I change it to get the right algorithm?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:48:45+00:00Added an answer on May 22, 2026 at 6:48 pm

    I’m not sure why you are doing this, but it is working as you designed. When timer1 ticks, it outputs a message and turns on timer2. Then timer1 ticks again but timer2 is already on so nothing happens there. Then timer2 ticks and turns off. That is why you are getting two timer1s for every timer2. Timer2 is already running the second time you try to turn it on.

    If you really want this to work right, you will probably need to add a third timer and then alternate between the two. Check to see if timer2 is running, and if it is, start timer3. Otherwise start timer2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I use two different back ends for an .net Entity Framework project? I
Referenced here and here ...Why would I use two's complement over an epsilon method?
The examples I can find use a two layer architecture, where the controllers directly
Is there any way to force Text-Mate to use a two-space tab instead of
We use BigIP to load balance between our two IIS servers. We recently deployed
I have two unrelated processes that use .NET assemblies as plugins. However, either process
I found two collapsing problems : You should use the same language between domain
I'm trying to use this layout with two 50% column width instead. But it
Currently I know of only two ways to cache data (I use PHP but
I use the Boost Test framework for my C++ code but there are two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.