Re: now.ticks does not work



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
>


.



Relevant Pages

  • Re: Initial 6.1 questions
    ... Two types of measurements are taken: ... simple array of tick counters called cp_time. ... each CPU, so those are a summary across all ...
    (freebsd-performance)
  • Re: Initial 6.1 questions
    ... system measurements are kept in a simple array of tick counters called cp_time. ... Ticks are measured on each CPU, so those are a summary across all ...
    (freebsd-performance)
  • Re: How do you set time-slicing for Windows XP
    ... (it can not be less than the tick period?) ... However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. ... Setting a higher resolution does not improve the accuracy of the high-resolution performance counter. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How do you set time-slicing for Windows XP
    ... (it can not be less than the tick period?) ... However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. ... Setting a higher resolution does not improve the accuracy of the high-resolution performance counter. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: GR ?
    ... > all the actual MEASUREMENTS show is a difference in MEASUREMENTS. ... > that could be due to EITHER a change in clocks' tick rates or in the ...
    (sci.physics.relativity)