Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I was wondering which would be the least resource intensive among the 3:

Timing m = 200, n = 100
1) 2 CWnd::SetTimer with 2 different IDs and 2 different timings

Timing m = 200, n = 100, where the greatest common divisor is one of them.
2) 1 CWnd::SetTimer with 1 ID and 1 timing where it is equal to 100 and the CWnd::OnTimer method has a counter which will call the relevant methods.

Timing m = 300, n = 200, where the greatest common divisor is not one of them.
3) 1 CWnd::SetTimer with 1 ID and 1 timing where it is equal to 100 and the CWnd::OnTimer method has a counter which will call the relevant methods.

If you can rank them, it would be even better. Thanks!
Posted
Updated 8-Sep-11 3:52am
v2

1 solution

Timers are a scarce resource: always use the absolute minimum you can get away with! So, go for 2 or 3 - but I don't see much difference between them from your description.
 
Share this answer
 
Comments
amsga 8-Sep-11 9:50am    
So if I were to say that my program have about 20 of these timers, I should try to group them together?
Philippe Mori 8-Sep-11 19:36pm    
Limits are mainly thing of the past (Windows 3.x and in some case Windows 9x/Me). Thus, you don't have to worry too much about that if you are reasonable.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900