Click here to Skip to main content
11,718,016 members (84,192 online)
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 11:26am
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 215
1 F-ES Sitecore 210
2 Maciej Los 140
3 Jochen Arndt 120
4 Andy Lanng 115
0 Sergey Alexandrovich Kryukov 1,649
1 OriginalGriff 535
2 Maciej Los 529
3 Richard MacCutchan 440
4 CHill60 415


Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 1 Apr 2013
Copyright © CodeProject, 1999-2015
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