简体   繁体   中英

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 that?!)

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.

time命令正是这样做的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM