i have an integer whose value changes, i like to know if there is a way to check whether the value is same for 2 sec.
like if num = 2 for 2 sec then Messagebox.show(“for 2 sec”);
cause my numbers are changing instantly.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This might be superfluous, I like using DispatcherTimer. This will tick every 2 seconds to look for a change:
You would need to include
System.Windows.Threading.The good thing about DispatcherTimer is that it handles all the work of delegating to the UI thread.