Re: clock()

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 07/08/04


Date: Thu, 08 Jul 2004 16:43:00 -0400

Alexander Grigoriev wrote:
> The standard says:
> [...]
>
> Looks like the forwat wording is very ambiguous and clock() function is not
> obliged to return 0 at the start of the program. And "Processor time"
> meaning is never explained in the standard.

What precisely do you find ambiguous about the clock function
subsection of the standard? 'Era' is implementation-defined. MS
made it "the program execution", i.e. the process having control
of the CPU. Some other system could implement 'era' as 01.01.1900
for all we care, that's why the footnote is there, suggesting that
one should always get a reading when the program starts. However,
the standard does require the actual implementation to be documented
(see J.3.12).

Yes, "processor time" is not defined by the standard. But its not
being defined sounds more like an _excuse_ not to spend any effort
making sure that the library is what the programmer expects of it.
If MS C run-time library implementors have a problem understanding
what "processor time" is, let them write to me, I'll explain them.
In terms of MS's own Kernel library, no less.

And, sorry, I don't know what "forwat" is. And next time, please,
be a dear, don't top-post. Thanks a bunch!

V



Relevant Pages

  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... Keith Thompson wrote in message ... I don't believe I've misunderstood the C standard, ... The clock function determines the processor time used. ...
    (comp.lang.c)
  • Re: Pre 9/11/2001 the only existance of NIST
    ... NIST Cesium Atomic Clock is World's Most Precise ... the nation’s standard of time. ... DST: The eighth number is the daylight saving time flag, ...
    (rec.gambling.poker)
  • NIST will be called into action once again
    ... NIST Cesium Atomic Clock is World's Most Precise ... the nation’s standard of time. ... DST: The eighth number is the daylight saving time flag, ...
    (rec.gambling.poker)
  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... I don't believe I've misunderstood the C standard, ... "The clock function returns the implementation's best approximation..." ... Yes, the standard only requires an "approximation", but did you miss ... seconds of processor time while it was sleeping for 4 seconds and not ...
    (comp.lang.c)
  • Re: SR clocks - which book do you recommend
    ... >>>by my clocks, a clock in the moving frame passes my clocks and also ... >>>at twice the rate of my standard clock always matches the time shown ... >the same duration as compared to locally-at-rest standard durations. ...
    (sci.physics.relativity)