Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am needing help creating a WPF application where the user schedules a DATE in the future and a TIME in the future to where it will then call some method or do something else like go invisible. I am not concerned with what it does after the interval is set. I have all the needed functionality except for how to keep track of the time interval set by the user. I use the calendar tool to retrieve the user data. I created my own time picker for the user to pick the time. Now I just need a way of measuring that time and date against the system clock to then do something. Everything that I have read says to use the Dispatcher class to keep track of time. Is there another class? Or is there a better way in WPF to do this?
Posted
Comments
Richard C Bishop 1-Apr-13 18:01pm    
Point taken and agreed.
Sergey Alexandrovich Kryukov 2-Apr-13 10:50am    
The inquirer's account was deactivated due to extreme rudeness, as a result of abuse reports.
I removed all comments.
—SA

1 solution

No, if you simply need to track elapsed "real" time, use System.Diagnostics.Stopwatch:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[^].

This is the most accurate way of measuring time available.

As I cannot be sure I really can understand the scenario and the ultimate purpose of it from this question, this is just a suggestion. It's not clear what is is meant by "tracking". Anyway, it's important to know the best way of measuring elapsed time, for whatever reason.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900