Is there either a bash command or a Python library that will time the amount of time to execute a file/command? I want to be able to decide what language will work best for a task or have a way of knowing for certain that Python code A runs faster than Python code B. If there is a way of doing this, but this question is off topic, please leave a comment with search terms or other resources.
Share
Yes, it’s called the
timecommand. As intime command arg1 arg2 arg3.This outputs 3 fields, something like this:
The first is the actual wall-clock time. The second is how long the program spent in user space. The third is how long the program spent in kernel space.