Discussion:
clock() returns 0
(too old to reply)
g***@gmail.com
2006-07-17 16:16:19 UTC
Permalink
Hi,
Cannot find this anywhere but I'm confused why clock() returns 0.
OS is IRIX 6.5

Here's a code example:


#include <stdio.h>
#include <time.h>

int main()
{
clock_t start;
start = clock();
printf("start ==%d\n", start);
return 0;
}

In other environment, clock returns the # of seconds that elapsed since
1/1/70 (I think) but this does not seem to work under IRIX 6.5.

As always, appreciate any input.
Thanks
Walter Roberson
2006-07-17 16:56:27 UTC
Permalink
Post by g***@gmail.com
In other environment, clock returns the # of seconds that elapsed since
1/1/70 (I think) but this does not seem to work under IRIX 6.5.
No, it is time() that returns that. clock() is a counter of elapsed
CPU time.

Loading...