CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Timer or Watcher for function result

  1. #1
    Join Date
    Apr 2015

    Timer or Watcher for function result

    I have some value in process memory (not my process).
    I have address of this value and want to execute function or smth else on changing this value.
    I think to use timers but I think they are too slow - low resolution(I read smth from 10 to 50 ms) and uses CPU too much.
    Can you offer me some other solution with not very much cpu usage but with checking variable value nearly 1 to 5 ms.
    Thank you.

  2. #2
    Join Date
    Aug 2014

    Re: Timer or Watcher for function result

    You can do it in Threads. Create a void parameterless method

             private void MyFunction()
                while (yourValueIsNotGood)
                // here your value is good
                // do your action which you need
    Then call the method in thread

                System.Threading.Thread thread = new System.Threading.Thread(MyFunction);
                // you come here when you exit MyFunction() (i.e. your value is good)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)