Slurpee Posted January 25, 2005 Posted January 25, 2005 hey all, I have knocked up a small app that sits in the system tray until a predifined time is reached (read from an ini file) when it triggers an event. I'm having a little bit of trouble as I currently read the details and loop until the current time matches that of the file, this is obviously processor intensive. I guess I can add thie looping to a new worker thread and that will aid things but there must be a refined way of doing this...anyone good with vb.net?? all advice greatly appreciated. Quote
coldfusion244 Posted January 25, 2005 Posted January 25, 2005 hey all' date=' I have knocked up a small app that sits in the system tray until a predifined time is reached (read from an ini file) when it triggers an event. I'm having a little bit of trouble as I currently read the details and loop until the current time matches that of the file, this is obviously processor intensive. I guess I can add thie looping to a new worker thread and that will aid things but there must be a refined way of doing this...anyone good with vb.net?? all advice greatly appreciated.[/quote'] So, you're asking how can you use less CPU cycles? It's not good practice but a DoEvents statement? As for spawning a thread to do it, I would go with that. You could computer the number between the current time and the desired time, then have the new thread sleep for all but the last few ticks so that it has enough time to grab the processor and run the code and not miss the objective time. If that isn't what your asking could you be more precise? Quote -Sean
IngisKahn Posted January 25, 2005 Posted January 25, 2005 Why not just use a timer? Quote "Who is John Galt?"
coldfusion244 Posted January 25, 2005 Posted January 25, 2005 Why not just use a timer? Personally the timers that are included in VS.NET aren't all that accurate. Especially the further down in period you go. Quote -Sean
Ontani Posted January 26, 2005 Posted January 26, 2005 why do they need to be accurate? just let it count every 100 ms. there not clogging up anything If Now.Hours & ":" & Now.Minutes = fileTime Then 'Action End If Quote www.purevision.be :: www.devpoint.be
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.