Reducing time in C# Forms Control.set_Text(string) function

Posted by awshepard on Stack Overflow See other posts from Stack Overflow or by awshepard
Published on 2010-04-25T22:07:51Z Indexed on 2010/04/25 22:13 UTC
Read the original article Hit count: 293

Filed under:
|
|
|

Hoping for a quick answer (which SO seems to be pretty good for)...

I just ran a performance analysis with VS2010 on my app, and it turns out that I'm spending about 20% of my time in the Control.set_Text(string) function, as I'm updating labels in quite a few places in my app.

The window has a timer object (Forms timer, not Threading timer) that has a timer1_Tick callback, which updates one label every tick (to give a stop-watch sort of effect), and updates about 15 labels once each second.

Does anyone have quick suggestions for how to reduce the amount of time spent updating text on a form, other than increasing the update interval? Are there other structures or functions I should be using?

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows.forms