Re: clock()

Tech-Archive recommends: Fix windows errors by optimizing your registry

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


Date: Thu, 08 Jul 2004 10:19:44 -0400

Carl Daniel [VC++ MVP] wrote:
> Victor Bazarov wrote:
>
>
>>I wonder whether Microsoft people know about the 'clock' problem...
>
>
> ... since clock() is apparently behaving exactly the way the MSDN
> documentation says it behaves, I'd guess that they know about it, yes.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_clock.asp
>
> "Return Value
>
> The elapsed wall-clock time since the start of the process (elapsed time in
> seconds times CLOCKS_PER_SEC). If the amount of elapsed time is unavailable,
> the function returns -1, cast as a clock_t.
> "

But I've not seen it listed in the Standard [non-]Compliance section.
IMO it should be. The Standard states that 'clock' should return
"the implementation’s best approximation to the _processor_ time used
  by the program since the beginning of an implementation-defined era
  related only to the program invocation." (emphasis mine). It is rather
apparent that it's not the _best_ approximation, wouldn't you say?

So, my statement should rather have been "I wonder whether Microsoft
people recognise the 'clock' behaviour as non-standard", which I guess
they don't because the documentation states "ANSI" in "Compatibility"
section.

V



Relevant Pages

  • Re: NTP for dummies
    ... I didn't write the documentation or rfc1305 or NTP project page or the book for dummies and dummies shouldn't read them. ... I believe this can be done because the NTP pages make reference to an "Undisciplined Local Clock" but as with all the documentation it assumes you are already an expert so no simple example is given. ...
    (comp.protocols.time.ntp)
  • Re: clock()
    ... since clock() is apparently behaving exactly the way the MSDN ... It looks that they've changed the documentation, ... wall-clock time, wall-clock time of the start of the process is ... where one would expect real time measurements. ...
    (microsoft.public.vc.language)
  • Re: Experiencing problems when moving an FPGA-based implementation to an ASIC
    ... Simple clock in, clock out buffer. ... the ASIC implementation as CTS can implement this itself. ... According to the documentation, xilinx ... implementation tools allow RDY to be unconnected/ignored. ...
    (comp.arch.fpga)
  • Re: Experiencing problems when moving an FPGA-based implementation to an ASIC
    ... Simple clock in, clock out buffer. ... the ASIC implementation as CTS can implement this itself. ... According to the documentation, xilinx ... implementation tools allow RDY to be unconnected/ignored. ...
    (comp.arch.fpga)
  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... out loud. ... Neither the standard's definition of clock() nor your implementation's ... Your system unambiguously violates both the standard and its own ... documentation. ...
    (comp.lang.c)