Is clock C function appropriate as clock counter?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Is clock C function appropriate as clock counter?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Is clock C function appropriate as clock counter?  
Leonardo Barbosa e Oliveira


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-04 10:57 PM



Hello, everybody!

I am using the C function clock() as a counter
of number of ticks of my programm. I am newbie in benchmarking
architectures so please let me know  if i am the
right thing. I am using a Ultra-Sparc 5

thanks in advance!

The function is described here:

http://htmlhelp.sunsite.dk/page.php/9/ch22s03.html

Leonardo


=09"A gente s=F3 sabe bem aquilo que n=E3o entende".
=09=09=09=09 Guimar=E3es Rosa





[ Post a follow-up to this message ]



    Re: Is clock C function appropriate as clock counter?  
Nick Landsberg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-16-04 10:57 PM

Leonardo Barbosa e Oliveira wrote:
>=20
> Hello, everybody!
>=20
> I am using the C function clock() as a counter
> of number of ticks of my programm. I am newbie in benchmarking
> architectures so please let me know  if i am the
> right thing. I am using a Ultra-Sparc 5
>=20
> thanks in advance!
>=20
> The function is described here:
>=20
> http://htmlhelp.sunsite.dk/page.php/9/ch22s03.html
>=20
>      Leonardo
>=20
>=20
> 	"A gente s=F3 sabe bem aquilo que n=E3o entende".
> 				 Guimar=E3es Rosa

clock() is OK, but I prefer all the extra data
that getrusage() provides, like the split
between user time and system time, messages
sent/recieved, etc.

At first you won't know which other stuff
that getrusage() gives you is important to
you or not, but you'll have the info without
having to swap our one subroutine call for
another.

NPL

--=20
"It is impossible to make anything foolproof
because fools are so ingenious"
- A. Bloch





[ Post a follow-up to this message ]



    Re: Is clock C function appropriate as clock counter?  
Pete Brett


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-21-04 03:32 AM

Leonardo Barbosa e Oliveira <leob@dcc.ufmg.br> wrote:

>
>
>Hello, everybody!
>
>I am using the C function clock() as a counter
>of number of ticks of my programm. I am newbie in benchmarking
>architectures so please let me know  if i am the
>right thing. I am using a Ultra-Sparc 5
>
I generally use time(1). It has the advantage that you need not alter any co
de
and that it gives a more detailed output of user and system time.

If you want to benchmark individual functions as opposed to your whole progr
am
then you might be better using getruseage(). You could also look into using
gprof if it is available on your platform.

Pete





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:29 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register