[RESOLVED] old timer not working in this version of vb
I've used this construct before and it worked fine. The idea is to release control to the system so that it can do "housekeeping". Leaving this out in the past caused the system to run out of memory eventually. (I'm doing alot of image loading and unloading). Visual Studio/ Visual Basic 2005 version 8.0.5
System.Threading.Thread.CurrentThread.Sleep(10)
get this error:
Warning 2 Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. C:\Visual Studio\Projects\Tracker\Form1.vb 627 17 Tracker
Is there a newer construct?
Last edited by cageybee; Jun 27th, 2008 at 08:26 AM.
cageybee - is that name a rounders reference in some way??? or just a russian one?
anyways, these guys told you your answer, but I just wanted to chime in and say a few things.
1) That is actually not an error, it is a warning, and there is a difference. The difference is the app will still run with the warning, and it will actually run correctly. It is just telling you what it plans to do at runtime, which is to use the correct version instead of the one you used.
2) If you were to mouse over this line of code in VS, you would see a little red ! come up. Clicking the ! will bring up a correction window, because VS already knows how you need to fix this. You can simply click the correction in this window, and it will fix your code for you.
The part circled in the screenshot is what you would click to auto fix your code.
Also sleeping a thread is not the same thing as a timer, as sleeping the thread will freeze the thread. If its only for 10 milliseconds, then its generally not a big deal, however timers may be a better option depending on what exactly is going on.
Thanks to all. cageybee is a "name" i've gone by for 40 years. It is a play on my initials KGB. I use it in gaming, and own the domains. Thanks especially for the tip on how to find the solution!! I live in the Charlottesville area now.....the mountains were calling!
I suppose if the app worked fine in the past, and didn't lag as a result of the sleep call, then you might as well go with it, but the whole description makes me think that there is a better answer, especially if this is the UI thread.
Not looking to take this thread off topic, but since its marked resolved, it was a movie with ed norton and matt damon about poker. It actually came out in 1998 which was pretty much right before the huge poker boom that America has seen.