查找函数所花费的时间 [英] Finding the time taken by a function

查看:67
本文介绍了查找函数所花费的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我编写了一个大型程序,可以多次调用该程序的

函数(也由我编写)。现在,我想知道对特定函数的所有调用所花费的

集体时间。这是我能找到的任何方式



提前致谢,

Raja Kiran Sandireddy。

Hi,

I have written a large program which makes multiple calls to number of
functions (also written by me) of the program. Now, I want to know the
collective time taken by all the calls to a specific function. Is
there any way I can find this time.
Thanks in advance,
Raja Kiran Sandireddy.

推荐答案

如果你不在乎结果的准确程度(并且不需要更好的

岁差而不是秒) ,你可以在调用你想要的

函数之前调用time(),然后在它再次返回调用时间()之后再调用

减去这些值。 />

Yaniv


< sr ******* @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...
If you don''t care how accurate the results are (and don''t need better
precession than just seconds), you can call time() before you call the
function you want to time, and then after it returns call time() again and
subtract the values.

Yaniv

<sr*******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...


我写了一个大程序,它可以多次调用程序的多个
函数(也是由我编写的)。现在,我想知道所有对特定函数的调用所花费的集体时间。我有什么方法可以找到这个时间。
提前致谢,Raja Kiran Sandireddy。
Hi,

I have written a large program which makes multiple calls to number of
functions (also written by me) of the program. Now, I want to know the
collective time taken by all the calls to a specific function. Is
there any way I can find this time.
Thanks in advance,
Raja Kiran Sandireddy.



哇,这是一个错误的错误,精确。


Yaniv Oliver < yaniv(at)softlink.com>在留言中写道

新闻:41 ******** @ news.012.net.il ...
Wow, that was a bad typo, precision.

"Yaniv Oliver" <yaniv (at) softlink.com> wrote in message
news:41********@news.012.net.il...
如果你不在乎有多准确结果是(并且不需要更好的进动而不仅仅是秒),你可以在调用你想要的时间之前调用时间(),然后在它返回调用时间之后()再次和
减去价值。

Yaniv

< sr ******* @ gmail.com>在消息中写道
新闻:11 ********************** @ z14g2000cwz.googlegr oups.com ...
If you don''t care how accurate the results are (and don''t need better
precession than just seconds), you can call time() before you call the
function you want to time, and then after it returns call time() again and
subtract the values.

Yaniv

<sr*******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...


我已经编写了一个大程序,可以多次调用程序的多个
函数(也由我编写)。现在,我想知道所有对特定函数的调用所花费的集体时间。我有什么方法可以找到这个时间。
提前致谢,Raja Kiran Sandireddy。
Hi,

I have written a large program which makes multiple calls to number of
functions (also written by me) of the program. Now, I want to know the
collective time taken by all the calls to a specific function. Is
there any way I can find this time.
Thanks in advance,
Raja Kiran Sandireddy.




哇,你们两个顶级帖子,这都是坏事。


请停止!


Yaniv奥利弗" < yaniv(at)softlink.com>在留言中写道

新闻:41 ******** @ news.012.net.il ...
Wow, you both top post, which is a Bad Thing.

Please stop!

"Yaniv Oliver" <yaniv (at) softlink.com> wrote in message
news:41********@news.012.net.il...
哇,这是一个错误的拼写错误,精确。

Yaniv Oliver < yaniv(at)softlink.com>在消息中写道
新闻:41 ******** @ news.012.net.il ...
Wow, that was a bad typo, precision.

"Yaniv Oliver" <yaniv (at) softlink.com> wrote in message
news:41********@news.012.net.il...
如果你不在乎结果有多准确(并且不需要
更好的岁差而不仅仅是几秒钟),你可以在你想要计时的函数
之前调用time(),然后在它返回通话时间之后()
再次减去价值观。

Yaniv

< sr ******* @ gmail.com>在消息中写道
新闻:11 ********************** @ z14g2000cwz.googlegr oups.com ...
If you don''t care how accurate the results are (and don''t need better precession than just seconds), you can call time() before you call the function you want to time, and then after it returns call time() again and subtract the values.

Yaniv

<sr*******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...


我已经编写了一个大程序,可以多次调用该程序的
函数(也是由我编写的)。现在,我想知道
所有对特定函数的调用所花费的集体时间。我有什么方法可以找到这个时间。
提前致谢,Raja Kiran Sandireddy。
Hi,

I have written a large program which makes multiple calls to number of functions (also written by me) of the program. Now, I want to know the collective time taken by all the calls to a specific function. Is
there any way I can find this time.
Thanks in advance,
Raja Kiran Sandireddy.





这篇关于查找函数所花费的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆