Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 1-Apr-13 12:26pm
Comments
richcb at 1-Apr-13 18:01pm
   
Point taken and agreed.
Sergey Alexandrovich Kryukov at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100