We are currently running the Compact Framework V1 on a
CE.NET 4.2 platform. The platform has all of the latest
QFE's applied.

We have noticed odd behaviour with
System.Environment.TickCount. We have a thread which
loops continuously, sleeping for 100ms on every
itteration of the loop. Inside this loop
System.Environment.TickCount is called and its value is
recorded. Normally we see the tick count value
incrementing by approximately 100 on each pass, however
at random intervals the tick count value increments by a
massive amount. We have left this routine on soak test
over night and have found that the tick count value will
generally jump 3 times during the night. The amount of
the jump is equivalent to about 19 minutes of time.

According to the CE.NET API, the GetTickCount() function
which I presume System.Environment.Tick wraps, will
eventually rollover approximatly once every 24 days.
However the values we are getting are nowhere near the
uint limit.

What is going on here ?

Regards

Steve

Re: Odd behaviour of System.Environment.TickCount by Paul

Paul
Wed Nov 05 09:29:02 CST 2003

A couple of things to check:

1. Are you calling Sleep( 100 ) *exactly* or might you be calculating how
long to sleep? If you are calculating, maybe you have a bug there.

2. Do you have a C program that shows the same problem or is C 100%
reliable. This will tell us where to look. I'm guessing that C does the
same thing and theres a bug in your kernel code, but it could be a .NET CF
problem.

Paul T.

"Steve Wilkinson" <anonymous@discussions.microsoft.com> wrote in message
news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
> We are currently running the Compact Framework V1 on a
> CE.NET 4.2 platform. The platform has all of the latest
> QFE's applied.
>
> We have noticed odd behaviour with
> System.Environment.TickCount. We have a thread which
> loops continuously, sleeping for 100ms on every
> itteration of the loop. Inside this loop
> System.Environment.TickCount is called and its value is
> recorded. Normally we see the tick count value
> incrementing by approximately 100 on each pass, however
> at random intervals the tick count value increments by a
> massive amount. We have left this routine on soak test
> over night and have found that the tick count value will
> generally jump 3 times during the night. The amount of
> the jump is equivalent to about 19 minutes of time.
>
> According to the CE.NET API, the GetTickCount() function
> which I presume System.Environment.Tick wraps, will
> eventually rollover approximatly once every 24 days.
> However the values we are getting are nowhere near the
> uint limit.
>
> What is going on here ?
>
> Regards
>
> Steve



Re: Odd behaviour of System.Environment.TickCount by Steve

Steve
Wed Nov 05 09:46:33 CST 2003

Paul,

I'm calling Sleep with a fixed value.

I'll knock up a quick C/C++ test app and call the
GetTickCount() API function.

I'll also P/Invoke the same function, just to see if I
get the same behaviour.

Thanks

Steve

>-----Original Message-----
>A couple of things to check:
>
>1. Are you calling Sleep( 100 ) *exactly* or might you
be calculating how
>long to sleep? If you are calculating, maybe you have a
bug there.
>
>2. Do you have a C program that shows the same problem
or is C 100%
>reliable. This will tell us where to look. I'm
guessing that C does the
>same thing and theres a bug in your kernel code, but it
could be a .NET CF
>problem.
>
>Paul T.
>
>"Steve Wilkinson" <anonymous@discussions.microsoft.com>
wrote in message
>news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
>> We are currently running the Compact Framework V1 on a
>> CE.NET 4.2 platform. The platform has all of the
latest
>> QFE's applied.
>>
>> We have noticed odd behaviour with
>> System.Environment.TickCount. We have a thread which
>> loops continuously, sleeping for 100ms on every
>> itteration of the loop. Inside this loop
>> System.Environment.TickCount is called and its value is
>> recorded. Normally we see the tick count value
>> incrementing by approximately 100 on each pass, however
>> at random intervals the tick count value increments by
a
>> massive amount. We have left this routine on soak test
>> over night and have found that the tick count value
will
>> generally jump 3 times during the night. The amount of
>> the jump is equivalent to about 19 minutes of time.
>>
>> According to the CE.NET API, the GetTickCount()
function
>> which I presume System.Environment.Tick wraps, will
>> eventually rollover approximatly once every 24 days.
>> However the values we are getting are nowhere near the
>> uint limit.
>>
>> What is going on here ?
>>
>> Regards
>>
>> Steve
>
>
>.
>

Re: Odd behaviour of System.Environment.TickCount by Paul

Paul
Wed Nov 05 09:54:48 CST 2003

That should point out the culprit...

Paul T.

"Steve Wilkinson" <anonymous@discussions.microsoft.com> wrote in message
news:00c601c3a3b3$fcd5f660$a101280a@phx.gbl...
> Paul,
>
> I'm calling Sleep with a fixed value.
>
> I'll knock up a quick C/C++ test app and call the
> GetTickCount() API function.
>
> I'll also P/Invoke the same function, just to see if I
> get the same behaviour.
>
> Thanks
>
> Steve
>
> >-----Original Message-----
> >A couple of things to check:
> >
> >1. Are you calling Sleep( 100 ) *exactly* or might you
> be calculating how
> >long to sleep? If you are calculating, maybe you have a
> bug there.
> >
> >2. Do you have a C program that shows the same problem
> or is C 100%
> >reliable. This will tell us where to look. I'm
> guessing that C does the
> >same thing and theres a bug in your kernel code, but it
> could be a .NET CF
> >problem.
> >
> >Paul T.
> >
> >"Steve Wilkinson" <anonymous@discussions.microsoft.com>
> wrote in message
> >news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
> >> We are currently running the Compact Framework V1 on a
> >> CE.NET 4.2 platform. The platform has all of the
> latest
> >> QFE's applied.
> >>
> >> We have noticed odd behaviour with
> >> System.Environment.TickCount. We have a thread which
> >> loops continuously, sleeping for 100ms on every
> >> itteration of the loop. Inside this loop
> >> System.Environment.TickCount is called and its value is
> >> recorded. Normally we see the tick count value
> >> incrementing by approximately 100 on each pass, however
> >> at random intervals the tick count value increments by
> a
> >> massive amount. We have left this routine on soak test
> >> over night and have found that the tick count value
> will
> >> generally jump 3 times during the night. The amount of
> >> the jump is equivalent to about 19 minutes of time.
> >>
> >> According to the CE.NET API, the GetTickCount()
> function
> >> which I presume System.Environment.Tick wraps, will
> >> eventually rollover approximatly once every 24 days.
> >> However the values we are getting are nowhere near the
> >> uint limit.
> >>
> >> What is going on here ?
> >>
> >> Regards
> >>
> >> Steve
> >
> >
> >.
> >



Re: Odd behaviour of System.Environment.TickCount by Chris

Chris
Wed Nov 05 10:02:11 CST 2003

The kernel code is probably not correctly dealing with the OSCR register
wrap of the processor. Due to the frequency of that tick, it wraps about
every 19 minutes.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net

"Steve Wilkinson" <anonymous@discussions.microsoft.com> wrote in message
news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
> We are currently running the Compact Framework V1 on a
> CE.NET 4.2 platform. The platform has all of the latest
> QFE's applied.
>
> We have noticed odd behaviour with
> System.Environment.TickCount. We have a thread which
> loops continuously, sleeping for 100ms on every
> itteration of the loop. Inside this loop
> System.Environment.TickCount is called and its value is
> recorded. Normally we see the tick count value
> incrementing by approximately 100 on each pass, however
> at random intervals the tick count value increments by a
> massive amount. We have left this routine on soak test
> over night and have found that the tick count value will
> generally jump 3 times during the night. The amount of
> the jump is equivalent to about 19 minutes of time.
>
> According to the CE.NET API, the GetTickCount() function
> which I presume System.Environment.Tick wraps, will
> eventually rollover approximatly once every 24 days.
> However the values we are getting are nowhere near the
> uint limit.
>
> What is going on here ?
>
> Regards
>
> Steve



Re: Odd behaviour of System.Environment.TickCount by Chris

Chris
Wed Nov 05 11:29:48 CST 2003

Yep, because it is hardware dependent.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net

"Steve Wilkinson" <anonymous@discussions.microsoft.com> wrote in message
news:104e01c3a3c0$e62ea210$a601280a@phx.gbl...
> Chris,
>
> Is it the responsibility of the OEM Vendor to implement
> the GetTickCount() function ?
>
> Steve
> >-----Original Message-----
> >The kernel code is probably not correctly dealing with
> the OSCR register
> >wrap of the processor. Due to the frequency of that
> tick, it wraps about
> >every 19 minutes.
> >
> >--
> >Chris Tacke, eMVP
> >Co-Founder and Advisory Board Member
> >www.OpenNETCF.org
> >---
> >Windows CE Product Manager
> >Applied Data Systems
> >www.applieddata.net
> >
> >"Steve Wilkinson" <anonymous@discussions.microsoft.com>
> wrote in message
> >news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
> >> We are currently running the Compact Framework V1 on a
> >> CE.NET 4.2 platform. The platform has all of the
> latest
> >> QFE's applied.
> >>
> >> We have noticed odd behaviour with
> >> System.Environment.TickCount. We have a thread which
> >> loops continuously, sleeping for 100ms on every
> >> itteration of the loop. Inside this loop
> >> System.Environment.TickCount is called and its value is
> >> recorded. Normally we see the tick count value
> >> incrementing by approximately 100 on each pass, however
> >> at random intervals the tick count value increments by
> a
> >> massive amount. We have left this routine on soak test
> >> over night and have found that the tick count value
> will
> >> generally jump 3 times during the night. The amount of
> >> the jump is equivalent to about 19 minutes of time.
> >>
> >> According to the CE.NET API, the GetTickCount()
> function
> >> which I presume System.Environment.Tick wraps, will
> >> eventually rollover approximatly once every 24 days.
> >> However the values we are getting are nowhere near the
> >> uint limit.
> >>
> >> What is going on here ?
> >>
> >> Regards
> >>
> >> Steve
> >
> >
> >.
> >



Re: Odd behaviour of System.Environment.TickCount by Geoff

Geoff
Thu Nov 06 12:09:56 CST 2003

There is a FAQ entry describing the various methods for timing that you may
find useful.

7.2. How can I calculate an accurate time interval?
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx#7.2

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
"Steve Wilkinson" <anonymous@discussions.microsoft.com> wrote in message
news:040e01c3a385$bdae23f0$a001280a@phx.gbl...
> We are currently running the Compact Framework V1 on a
> CE.NET 4.2 platform. The platform has all of the latest
> QFE's applied.
>
> We have noticed odd behaviour with
> System.Environment.TickCount. We have a thread which
> loops continuously, sleeping for 100ms on every
> itteration of the loop. Inside this loop
> System.Environment.TickCount is called and its value is
> recorded. Normally we see the tick count value
> incrementing by approximately 100 on each pass, however
> at random intervals the tick count value increments by a
> massive amount. We have left this routine on soak test
> over night and have found that the tick count value will
> generally jump 3 times during the night. The amount of
> the jump is equivalent to about 19 minutes of time.
>
> According to the CE.NET API, the GetTickCount() function
> which I presume System.Environment.Tick wraps, will
> eventually rollover approximatly once every 24 days.
> However the values we are getting are nowhere near the
> uint limit.
>
> What is going on here ?
>
> Regards
>
> Steve