且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

System.Windows.Forms.Timer性能

更新时间:2023-12-06 14:22:40

有没有额外的线程。刚才有很多WM_TIMER消息进来的线程的消息队列中。因此,这些计时器将不执行他们的code平行,即使其时间跨度重叠。

There is no additional thread. There are just a lot of WM_TIMER messages coming in your thread's message queue. So these timers won't execute their code in parallel, even if their timespans overlap.

我认为它不会伤害有埃维控制一个单独的计时器。至少它肯定不会比使用单一的计时器任何可测量的性能差异。在code将获得更具可读性,但。 ;)

I think that it wouldn't hurt to have a separate timer for evey control. At least it definately won't have any measureable performance difference over using a single timer. The code will get more readable though. ;)

顺便说一句 - 与今天的大规模转移到多个CPU内核,考虑是否这也许不是一个地方,你可以从中受益。

Btw - with todays massive move to multiple CPU cores, consider if this perhaps isn't a place where you can benefit from it.