Re: Counting milliseconds on PPC

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alex Feinman [MVP] (public_news_at_alexfeinman.com)
Date: 11/29/04


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.
>>>>
>>>>
>>>
>>>
>>
>>
>
> 


Relevant Pages

  • Re: Counting milliseconds on PPC
    ... The RTC in PPC devices still runs when it's powered off. ... you can have a stopwatch functionality. ... actually counting milliseconds between power-off and subsequent power-on. ... >>> power was off, battery-backed hardware. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Counting milliseconds on PPC
    ... of external, battery-operated timer, is going to run when the device is ... > Thanks Paul, I looked back at the documentation, and the point about ... > that users may want to time events that last longer than their ... I would not really need it to keep counting ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Tuesday Still Shots 12/13/05
    ... >I'm not sure what made it SJP's reaction to the swearing or Paul ... >getting in the "counting your Everybody Loves Raymond residuals, ... >syndication version." ...
    (alt.fan.letterman)
  • Re: WINCE .NET 4.2/Accelent
    ... SYSINTR_NETWORK out of nkintr.h and recompiling your platform to see if ... someone else is counting on that definition and needs to have oalintr.h ... >>Paul T. ...
    (microsoft.public.windowsce.platbuilder)