.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Timer with Timer in C#.Net

Posted By: Narayanan     Posted Date: September 15, 2011    Points:5   Category :C#
Hi,
I used two timers in my Project. In that Timers, One Timer start in the One Timer Tick event. How will it perform?Is it good thing or Not?
Regards,
Lakshmi Narayanan.S

Responses
Author: Sasi Prabhu             
Posted Date: September 18, 2011     Points: 20   

Hi,

We can use multiple timer in a single project.


Thanks & Regards,
Sasi Prabhu.
Author: Narayanan             
Posted Date: September 19, 2011     Points: 20   

Hi,
Thanks for you reply.I know ,We can use Multiple Timer.But i am asking ,I have used 2 timer in my project)
Timer1 and Timer2). In Timer1_Tick , I started Timer2 .Is it good Or not ?Regards,How are they performance?
Lakshmi Narayanan.S


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Pankaj Chahar             
Posted Date: November 26, 2011     Points: 20   

Hi,

Here is the real time example(2 timers working parallely ) with enhanced code performance.....

static void Main(string[] args)
{
int seconds = 2;
Timer time = new Timer(seconds * 1000); //to milliseconds
time.Enabled = true;
time.Elapsed += new ElapsedEventHandler(MyHandler);

time.Start();

Console.ReadKey();
}

private static void MyHandler(object e, ElapsedEventArgs args)
{
var timer = (Timer) e;
timer.Stop();
}




Pankaj Chahar

Deserve More..




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend