John
02-28-2002, 08:34 PM
Attached is a little program which was written as an introduction for myself and others to subclassing. As an added bonus it will show you how in-accurate the intrinsic timer control in VB really is.
Here is the story:
After writing the simple subclassing app I decided to place a timer on the form and keep track of the time that the subclassing was going on. After doing this I decided to keep a count of the messages being displayed in the text box. Here is where I noticed how bad the problem can get with the Intrinsic Timer, while moving the form around it seems to miss firing when it should:-\. To keep track of the actual time I deided to use GetTickCount in the new window procedure and presto, it keeps much more accurate although not perfect time. It is really quite interesting. Here is what it shows:
- Displays some of the messages it recieves
- Keeps track of the number of messages displayed
- Keeps track of the total number of messages that came through
- Uses a timer control and shows the in-accuracy of it
- Uses GetTickCount to get a better estimate of time
- Shows how many messages per second came through
Check it out, and let me know what you think.
Happy Coding,
Orbity
Here is the story:
After writing the simple subclassing app I decided to place a timer on the form and keep track of the time that the subclassing was going on. After doing this I decided to keep a count of the messages being displayed in the text box. Here is where I noticed how bad the problem can get with the Intrinsic Timer, while moving the form around it seems to miss firing when it should:-\. To keep track of the actual time I deided to use GetTickCount in the new window procedure and presto, it keeps much more accurate although not perfect time. It is really quite interesting. Here is what it shows:
- Displays some of the messages it recieves
- Keeps track of the number of messages displayed
- Keeps track of the total number of messages that came through
- Uses a timer control and shows the in-accuracy of it
- Uses GetTickCount to get a better estimate of time
- Shows how many messages per second came through
Check it out, and let me know what you think.
Happy Coding,
Orbity