Re: get the time needed to process one function.



Ian Collins wrote:
George Orwell wrote:

.... snip ...

The C standard doesn't specify a particular resolution, and you
can't even examine the value of CLOCKS_PER_SEC to determine the
particular resolution used.

Why not?

I see no reason.

7.23.2.1 The clock function

Synopsis

[#1]
#include <time.h>
clock_t clock(void);

Description

[#2] The clock function determines the processor time used.

Returns

[#3] The clock function returns 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. To determine the time in
seconds, the value returned by the clock function should be
divided by the value of the macro CLOCKS_PER_SEC. If the
processor time used is not available or its value cannot be
represented, the function returns the value (clock_t)-1.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
.



Relevant Pages

  • Re: Another Tricky Problem I am Messing With (Not Homework)
    ... just pointed out your and Keith Thompson's ... I don't believe I've misunderstood the C standard, ... The clock function determines the processor time used. ...
    (comp.lang.c)
  • Re: speed of execution
    ... pete wrote: ... The clock function in is for timing programs ... The clock function determines the processor time used. ...
    (comp.lang.c)
  • Re: speed of execution
    ... The clock function in is for timing programs ... The clock function determines the processor time used. ... approximation to the processor time used by the program ...
    (comp.lang.c)
  • Re: speed of execution
    ... The clock function in is for timing programs ... The clock function determines the processor time used. ...
    (comp.lang.c)
  • Re: clock() function
    ... > "The clock function returns the implementation’s best approximation to the ... > only to the program invocation. ... > below) wrap, so storing that in a double won't help, and the period the OP ... Maybe someone else will add more input about the standard. ...
    (comp.lang.c)