|
|
|
start date: Sat, 28 Jul 2007 18:48:46 -0000,
posted on: microsoft.public.dotnet.framework.compactframework
back
| Thread Index |
|
1
silverfox
|
|
2
ctacke/ ctacke[at]opennetcf[dot]com
|
|
3
silverfox
|
How to get accurate elapsed time ?
I was surprised to find that DateTime.Now.Ticks on my Pocket PC always
returns a value like 633212192210000000. And about 4 seconds later the
value returned is 633212192250000000. You always get seven zeros on
the end, meaning that there are no significant digits past the
seconds. I need at lease tenth second accuracy for my application.
Is there a way? I am using VB, for what it is worth.
Date:Sat, 28 Jul 2007 18:48:46 -0000
Author:
|
Re: How to get accurate elapsed time ?
DataTime.Now on most Windows CE devices is only valid to the second. If you
need sub-second resolution, use Environment.TickCount, which is milliseconds
(watch for wrap). If you need even finere, the P/Invoke
QueryPerformanceCounter.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
"silverfox" wrote in message
news:1185648526.721441.325200@i13g2000prf.googlegroups.com...
>I was surprised to find that DateTime.Now.Ticks on my Pocket PC always
> returns a value like 633212192210000000. And about 4 seconds later the
> value returned is 633212192250000000. You always get seven zeros on
> the end, meaning that there are no significant digits past the
> seconds. I need at lease tenth second accuracy for my application.
> Is there a way? I am using VB, for what it is worth.
>
Date:Sat, 28 Jul 2007 15:30:06 -0500
Author:
|
Re: How to get accurate elapsed time ?
On Jul 28, 1:30 pm, "<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote:
> DataTime.Now on most Windows CE devices is only valid to the second. If you
> need sub-second resolution, use Environment.TickCount, which is milliseconds
> (watch for wrap). If you need even finere, the P/Invoke
> QueryPerformanceCounter.
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Managed Code in an Embedded Worldwww.OpenNETCF.com
>
> "silverfox" wrote in message
>
> news:1185648526.721441.325200@i13g2000prf.googlegroups.com...
>
> >I was surprised to find that DateTime.Now.Ticks on my Pocket PC always
> > returns a value like 633212192210000000. And about 4 seconds later the
> > value returned is 633212192250000000. You always get seven zeros on
> > the end, meaning that there are no significant digits past the
> > seconds. I need at lease tenth second accuracy for my application.
> > Is there a way? I am using VB, for what it is worth.
Perfect! I knew that there must be a way and I was pretty certain
that someone on this list would know what it was. Thanks!
Date:Sun, 29 Jul 2007 04:08:33 -0000
Author:
|
|
|