clock_t clock() ambiguity

P

Phlip

peter said:
Could it be that Solaris and Windows NT shares a flawed codebase from
some time in the distant past?

I always suspected WinNT's clock() to return wall-clock time for a simple
reason: The function has only an 18 millisecond resolution, or some high
number like that. So if it's already useless for timing and profiling, then
there's no point in making it return processor time.
 
M

Matt

Default said:
Phlip wrote:




I'm not sure what faith. The documentation is either inconsistent,
confusing, or just wrong.

This whole conversation seemed somewhat familiar, a bit of Groupling
came up with this:

<http://groups.google.com/group/comp.lang.c++/browse_frm/thread/fb0f9076
19ac71fe/7a52324dcae9a6fd>

Thanks for that link. It came up mangled in my browser. Hope this works:
http://groups.google.com/group/comp.lang.c++/browse_frm/thread/fb0f907619ac71fe/7a52324dcae9a6fd
 
M

Matt

Victor said:
it's implementation-specific and we don't discuss implementations.

Okay, if you insist on being impractical, I am proposing a standard
replacement for clock_t clock(). The rationale is that Microsoft and
possibly others seem to have ruined clock()'s meaning and its usefulness
for cross-platform development. I propose we call it cpu_clock() or
maybe correct_clock() or lets_hope_ms_gets_it_right_this_time_clock().

Sheesh.
 
V

Victor Bazarov

Matt said:
Okay, if you insist on being impractical,

No, I insist on being on topic. If you have some complaints about some
implementations, take it up with the creator of those implementations.
Bitching about it here is not going to help.
I am proposing a standard
replacement for clock_t clock(). The rationale is that Microsoft and
possibly others seem to have ruined clock()'s meaning and its
usefulness for cross-platform development. I propose we call it
cpu_clock() or maybe correct_clock() or
lets_hope_ms_gets_it_right_this_time_clock().
Sheesh.

Whatever.

V
 
M

Matt

Victor said:
Also, complaining about free advice is non-sensical. You asked a question,
you received _a_ response. Take it or leave it, don't bitch about it.

I would hope that anybody who posts on usenet has higher expectations
than that. I know that there are a lot who don't, but if you don't want
more than that, what are you doing here and what do you think others are
doing here?

Now don't get non-sensical about my post. Please take my post or leave
it and don't bitch about it. :)
 
P

peter koch

Default User skrev:
I'm not sure what faith. The documentation is either inconsistent,
confusing, or just wrong.

This whole conversation seemed somewhat familiar, a bit of Groupling
came up with this:

<http://groups.google.com/group/comp.lang.c++/browse_frm/thread/fb0f9076
19ac71fe/7a52324dcae9a6fd>
I just read that - interestimng. I just wonder how my investigations
on Solaris (also gcc .... 3.2 so far as i remember) made me conclude
that clock() is elapsed time there as well. I also had one large sleep
for about five seconds.

/Peter
 
D

Default User

peter said:
Default User skrev:

Here's the compiler/OS info for my test:

Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.3.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/l
d --disable-nls
Thread model: posix
gcc version 3.3.1
 
D

Default User

Default said:
peter koch wrote:
Here's the compiler/OS info for my test:

Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.3.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/l
d --disable-nls
Thread model: posix
gcc version 3.3.1


Sorry about that, accidentally posted before finishing the edit. It
should look a bit cleaner now.



Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top