Re: now.ticks does not work
- From: "Willie jan" <unknown@xxxxxxxxxx>
- Date: Fri, 19 Aug 2005 09:45:02 +0200
aaahhhh now i see the light!
thanks for your clear answer.
Willie.
"Armin Zingler" <az.nospam@xxxxxxxxxx> schreef in bericht
news:e1IIWd9oFHA.2904@xxxxxxxxxxxxxxxxxxxxxxx
> "Willie jan" <unknown@xxxxxxxxxx> schrieb
>> my sleep was 3 ms, so it should show it.
>
> As I wrote, the resolution is 0.01s, and 3 ms < 0.01s
>
>> the strange thing is, sometimes you get a value >0, but not always.
>
> If the timer happend to tick just between the first and 2nd call to 'Now',
> you get a difference.
>
> Have a look @ a time scale: (Use a fixed font for viewing!)
>
> 0.03 seconds:
>
> [---------|---------|---------]
> ^ ^
>
> The "|" represent the ticks. They indicate at which point 'Now' returns a
> new value. As the resolution is 0.01 seconds, this happens every 0.01
> seconds. 'Now' returns 0.00 til the first tick. 'Now' returns 0.01 between
> the first and 2nd tick. It returns 0.02 after the 2nd tick.
>
> The "^" indicate the points where the measurements take place. If
> something
> takes 3ms, you get 0.00 and 0.00 twice because there was no tick
> inbetween.
> Difference = 0.
>
> [---------|---------|---------]
> ^ ^
>
> If one measurement takes place before, the other one after the tick, the
> action took still 0.003 seconds, but you get a difference of 0.01 s, as
> you
> see.
>
> That's why you can get different results. As I've suggested already, use a
> timer with a higher resolution.
>
> Even if an action took 0.9999 seconds, you might get 0 as the difference
> as shown here:
>
> [---------|---------|---------]
> ^ ^
>
> You see?
>
>
> Armin
>
.
- References:
- now.ticks does not work
- From: Willie jan
- Re: now.ticks does not work
- From: Armin Zingler
- Re: now.ticks does not work
- From: Willie jan
- Re: now.ticks does not work
- From: Armin Zingler
- now.ticks does not work
- Prev by Date: Re: GDI+ move scroll zoom
- Next by Date: Re: now.ticks does not work
- Previous by thread: Re: now.ticks does not work
- Next by thread: Re: now.ticks does not work
- Index(es):
Relevant Pages
|