私は C を学んでおり、私の C コードの一部が Python の同等のものよりもどれだけ速いかを知りたいと思っています。
Ubuntu 12.04 を実行しています
私は C を学んでおり、私の C コードの一部が Python の同等のものよりもどれだけ速いかを知りたいと思っています。
Ubuntu 12.04 を実行しています
From command line you can use "time" command. This will give you the execution time of that program in three separate mode (by default) - a. real time; b. user time; c. system time.
a. real time indicates how much time it took overall; b. user time indicates how much time it took executing at userspace c. system time indicates how much time it took executing at kernel space.
Above is the way to measure time from commnad line. You can also measure program execution time from in program - using system call like gettimeofday().
You have the answer to your question there in the title: the time
command will measure the time it takes for a command to complete.