开发者

How to show running time in terminal?

I am using Python for a while and I learned that by some method like timeit() I can estimate the running time of my programe.

But, is it any way that when my programe finished in the terminal, it also print out the running time?! (any terminal command do tha开发者_Go百科t?!)


Use the following:

$ time your_programm

the output is:

$ time sleep 1

real 0m1.002s

user 0m0.000s

sys 0m0.000s

showing how much time was spent in kernel and user space and the total time spent.


The time command does exactly that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜