Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Which timer is better to update some controls?

timer safe controls

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 Hamed

Hamed

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 413 posts

Posted 02 August 2013 - 07:19 AM

Hello,

In .Net We have 3 timer:

1-System.Timer

2-Form.Timer

3-Threading.Timer

 

I want to update more that 95 control each 500ms (Some string check like String.Length and Convert with TryParse and some control happen in this timer)

 

Now which timer is better for me?



#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 02 August 2013 - 07:28 PM

No doubt it's the form timer, it's the contextually correct implementation.

Just check the amount of controls you need to check each time, looks like a lot.

I also suggest you don't use control.refresh, but form.refresh() when you are done with the updates.



#3 BlackDoom

BlackDoom

    CC Regular

  • Member
  • PipPipPip
  • 45 posts

Posted 07 August 2013 - 02:21 AM

 I agree with Rabit (O_O similar name, similar pictures we must be brothers :D) Nothing really beats .Net form timer in .Net framework, you have so much control and flexibility, it's also good if you're porting your project to other .Net languages (like VB) cuz it uses the same timer system



#4 AceInfinity

AceInfinity

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 313 posts

Posted 07 August 2013 - 06:18 PM

Anything "threaded" and you'll have to Invoke the UI thread anyways, which is just a waste of CPU time, and a performance loss really. System.Windows.Forms.Timer.

Microsoft MVP (2012) - .NET Programming | ®Crestron DMC-T Certified Programmer
Posted Image





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download