Re: Counting milliseconds on PPC
From: Alex Feinman [MVP] (public_news_at_alexfeinman.com)
Date: 11/29/04
- Next message: Alex Feinman [MVP]: "Re: XmlTextReader - how do I know the name of my variable"
- Previous message: Ed Debrot: "XmlTextReader - how do I know the name of my variable"
- In reply to: Paul G. Tobey [eMVP]: "Re: Counting milliseconds on PPC"
- Next in thread: Chris Tacke, eMVP: "Re: Counting milliseconds on PPC"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 29 Nov 2004 15:13:36 -0800
No, it is not, but do you think the OP really needs msecs? I mean if you
have to use your finger to press start/stop button, what do you care about a
few hundred msec anyway?
-- Alex Feinman --- Visit http://www.opennetcf.org "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> wrote in message news:uvW5rEl1EHA.2568@TK2MSFTNGP11.phx.gbl... > Not accurate to ms, though (most RTC clock chips aren't). > > Paul T. > > "Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message > news:uw8oswk1EHA.3236@TK2MSFTNGP15.phx.gbl... >> Wait, wait... The RTC in PPC devices still runs when it's powered off. >> You don't have to set your clock every time you hit a power button, do >> you? While this is not necessarily so in the generic CE devices, creating >> a stopwatch out of PPC is a feasible idea. With the caveat described by >> Chris (accuracy), you can have a stopwatch functionality. Nobody needs >> the device actually counting milliseconds between power-off and >> subsequent power-on. All he needs is to be able to tell upon resume that >> so many seconds have passed since the "Start" button in his application >> has been pressed. Now, if he needs to be able to to something when a time >> interval has elapsed and the device may be powered down at that point, >> then there is trouble since CeRunAppAtTime accuracy is way lower than it >> is acceptable for a stopwatch. >> >> So I'd go with GetTickCount - should work IMO >> >> -- >> Alex Feinman >> --- >> Visit http://www.opennetcf.org >> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> >> wrote in message news:O6hkCQk1EHA.1144@TK2MSFTNGP09.phx.gbl... >>> GetTickCount shouldn't suffer from that. As Chris indicated, only some >>> sort of external, battery-operated timer, is going to run when the >>> device is 'off'. >>> >>> Paul T. >>> >>> "Thomas Taylor" <thomas@community.nospam> wrote in message >>> news:u$F6C%23j1EHA.2624@TK2MSFTNGP11.phx.gbl... >>>> Thanks Paul, I looked back at the documentation, and the point about >>>> 0.5-second accuracy comes from the Framework documentation for >>>> System.Environment.TickCount >>>> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html >>>> /frlrfsystemenvironmentclasstickcounttopic.asp), which states "The >>>> resolution of the TickCount property cannot be less than 500 >>>> milliseconds." >>>> Perhaps this is a fudge factor for the managed environment to get the >>>> count? >>>> >>>> The practical reason for needing to keep counting when the device is >>>> off is >>>> that users may want to time events that last longer than their >>>> auto-suspend >>>> time. One could easily start the stopwatch and have the device turn >>>> itself >>>> off in the middle of the event. >>>> >>>> From a programming standpoint, I would not really need it to keep >>>> counting >>>> while it is off if, for example, I could save the start time (e.g., if >>>> DateTime.Now gave milliseconds) and then compute the elapsed time any >>>> time >>>> later, including after the device had been turned off and back on. >>>> >>>> Thomas >>>> >>>> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT >>>> com> >>>> wrote in message news:u4hq#hj1EHA.3416@TK2MSFTNGP09.phx.gbl... >>>>> 2) I don't see anywhere that the accuracy is only 0.5s. Certainly, on >>>>> our >>>>> devices, the resolution is 1ms and the accuracy is pretty good, unless >>>>> a >>>>> misbehaving driver has been installed and is disabling the timer >>>>> interrupt >>>>> for long periods of time. >>>>> >>>>> If you're going to have to keep counting when the device is off, I >>>>> think >>>>> you're *completely* out of luck. Why would a Pocket PC device want to >>>>> use >>>>> battery, even when off, to count something that 99.99% of all people >>>>> care >>>>> nothing about? You'd need special hardware to maintain the count >>>>> while >>>> the >>>>> power was off, battery-backed hardware. >>>>> >>>>> Paul T. >>>> >>>> >>> >>> >> >> > >
- Next message: Alex Feinman [MVP]: "Re: XmlTextReader - how do I know the name of my variable"
- Previous message: Ed Debrot: "XmlTextReader - how do I know the name of my variable"
- In reply to: Paul G. Tobey [eMVP]: "Re: Counting milliseconds on PPC"
- Next in thread: Chris Tacke, eMVP: "Re: Counting milliseconds on PPC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|