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

  • SEARCH
  • Home
  • 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 7539359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:21:40+00:00 2026-05-30T07:21:40+00:00

How do i stop the name from repeating itself at 10,000 times.. Right now

  • 0

How do i stop the name from repeating itself at 10,000 times.. Right now it repeats every 5 seconds.. but in 24hrs, it should only repeat a maximum of 10,000 times.. How do i stop the timer at a given time?

The program —:

class Timer1
{
   public System.Timers.Timer aTimer;


   public static void Main() 
   {
       System.Timers.Timer aTimer;
       aTimer = new System.Timers.Timer();
       aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
       aTimer.Interval = 5000;
       aTimer.Enabled = true;
       Console.WriteLine("Press Enter to Exit the Program");
       Console.ReadLine();
   }
    private static void OnTimedEvent(object source, ElapsedEventArgs e)
    {
        Console.WriteLine("Name YaP {0}", e.SignalTime);
    }

}
  • 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-30T07:21:41+00:00Added an answer on May 30, 2026 at 7:21 am
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Timers;
    
    namespace Time_Writer
    {
        class Program
        {
            static int count = 1;
            static double seconds
            private static System.Timers.Timer aTimer;
    
            static void Main(string[] args)
            {
                aTimer = new System.Timers.Timer();
                aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_Elapsed);
                aTimer.Interval = 8600;
                aTimer.Enabled = true;
                Console.WriteLine("Press Enter to Exit the Program\n");
                Console.ReadLine();
    
            }
            private static void aTimer_Elapsed(object source,ElapsedEventArgs e)
            {
    
                Console.WriteLine("Current time is :{0}\n ", e.SignalTime.TimeOfDay.ToString());
    
                seconds += 8.6;
                count += 1;
                if (count > 5 || seconds == 43) //change count to 10000, seconds to 86400
                {
                    aTimer.Enabled = false;
    
                    Console.WriteLine("Timer is off at {0}\n\n",e.SignalTime.TimeOfDay.ToString());
    
                    //Reset variables and re-enable the timer if you desire to.
                    count = 0;
                    seconds = 0;
                    aTimer.Enabled = true;
                }
            }
    
        }
    }
    

    I hope this helps you with your answer always glad to help!
    Visit the link below for more help.

    //http://msdn.microsoft.com/en-us/library/system.timers.elapsedeventargs.signaltime.aspx

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

Sidebar

Related Questions

I know how to reference a site by name to stop and start it?
How do you stop the designer from auto generating code that sets the value
How do I stop a function/procedure in a superclass from been overridden in a
I would like to stop images from loading, as in not even get a
How would i stop a jquery animation from loading upon user interaction? $('#jqNav li
Using EF 4.1 Code first I wanted to stop EF creating database from Models.
I'm trying to stop all tabs from loading when chrome starts up. I then
i use pregmatch to extract image name from article text ...so when admin dont
Please stop me before I make a big mistake :) - I'm trying to
How can i stop the host machine entering standby mode while my application is

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.