Re: Understanding PRIntervalTime

Nelson Bolyard <[email protected]>
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Joachim Ziegler wrote, On 2008-07-30 04:40:
> Hello,
> 
> I do not understand the meaning of the following sentences from
> 
> http://www.mozilla.org/projects/nspr/reference/html/prinrvl.html#20947
> 
> "Interval times are accurate regardless of host processing requirements
> and are very cheap to acquire.
> 
> The constants PR_INTERVAL_MIN and PR_INTERVAL_MAX define a range in
> ticks per second. These constants bound both the period and the
> resolution of a PRIntervalTime object."

These statements are descriptions of boundary conditions, requirements,
placed on the platform-dependent implementations of PRIntervalTime.

The underlying implementation may be VERY different from platform to
platform, The actual time resolution of PRIntervalTime varies from
box to box, but on all platforms:

- They are low overhead, quick, appropriate for use in loops.
  Less overhead than, say, gettimeofday

- the minimum amount of time, and the maximum amount of time, between
successive PRIntervalTime values is a value between the _MIN and _MAX
values (whose definitions are NOT platform dependent)

- They are believed to be accurate (if imprecise).  That is, they are
implemented in such a way that sample error (due to imprecision) is not
cumulative.   Of course, how such values are USED may be inaccurate,
but ...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.