For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > April 2004 > times() function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author times() function
Aless

2004-04-25, 5:35 pm

hi all
i'm using the the times() and clock() functions and i'm a little
:

struct tms tops;
clock_t tact;

tact = times(&tops);
printf("%g\n",(double)clock()/CLOCKS_PER_SEC);
printf("%g\n",(double)tact/CLOCKS_PER_SEC);
printf("%g\n",(double)tops.tms_utime/CLOCKS_PER_SEC);
printf("%g\n",(double)tops.tms_stime/CLOCKS_PER_SEC);

and i get the following:

6.79
9.6803
0.000675
4e-06

it is not suposed the return values of times() and clock are the same?
what are the units of tms_utime and tms_stime?
( tms_utime*10000 + tms_stime*10000 = cloc() ?)


thanks


--
Alex Lorca
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com