开发者

How to show running time in terminal?

开发者 https://www.devze.com 2023-04-07 16:16 出处:网络
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.

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

精彩评论

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

关注公众号