Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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.
Posted
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?

-Sean

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...