profiling (gprof) problem

P

Pasacco

dear

I need to know the execution time of the program. Below is just an
example. I used to use gprof. But in this case, the error messsage says
"gprof : gmon.out file is missing call-graph data".
Is it possible to 'gprof' with this ? Or it will be nice if someone
introduce how to measure execution time......
Thankyou for comment.


-------------------------------------------------------
/* http://www.cplusplus.com/ref/cstdlib/qsort.html */
/* qsort example */
#include <stdio.h>
#include <stdlib.h>

int values[] = { 40, 10, 100, 90, 20, 25 };

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}

int main ()
{
int * pItem;
int n;
qsort (values, 6, sizeof(int), compare);
for (n=0; n<6; n++)
{
printf ("%d ",values[n]);
}
return 0;
}
 
T

Tim Prince

Pasacco said:
dear

I need to know the execution time of the program. Below is just an
example. I used to use gprof. But in this case, the error messsage says
"gprof : gmon.out file is missing call-graph data".
Is it possible to 'gprof' with this ? Or it will be nice if someone
introduce how to measure execution time......
Thankyou for comment.


-------------------------------------------------------
/* http://www.cplusplus.com/ref/cstdlib/qsort.html */
/* qsort example */
#include <stdio.h>
#include <stdlib.h>

int values[] = { 40, 10, 100, 90, 20, 25 };

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}

int main ()
{
int * pItem;
int n;
qsort (values, 6, sizeof(int), compare);
for (n=0; n<6; n++)
{
printf ("%d ",values[n]);
}
return 0;
}
I don't think you have asked any on-topic questions, perhaps a forum
associated with your OS or compiler would be more helpful. But, it doesn't
appear that your program should run long enough to generate useful profiling
data. If you want only execution time, don't worry about the call graph.
If you want only over-all execution time, most OS provide a timer program,
either stand alone or as a shell command. Is your Google broken?
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top