avatar
n*s
1
Using gprof to profile the running time of a program, get the total time is
about 120s. At the same time, the "time" shell command gives ~180s.
In another case, the two could be ~170s and ~400s, respectively.
Should the time provided by gprof be almost the same as that counted by
"time"?
Thanks
avatar
k*l
2
time ./a.out 要给出三种时间的 real, user, system.
不只是系统时间。
avatar
k*l
3
Statistical Inaccuracy of gprof Output
Reason:
"The run-time figures that gprof gives you are based on a sampling proce
ss, so they are subject to statistical inaccuracy. "
"The sampling period that is printed at the beginning of the flat profil
e says how often samples are taken. The rule of thumb is that a run-time
figure is accurate if it is considerably bigger than the sampling perio
d. "
Solution:
"One way to get more accuracy is to give your program more (but similar)
input data so it will

【在 n*********s 的大作中提到】
: Using gprof to profile the running time of a program, get the total time is
: about 120s. At the same time, the "time" shell command gives ~180s.
: In another case, the two could be ~170s and ~400s, respectively.
: Should the time provided by gprof be almost the same as that counted by
: "time"?
: Thanks

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。