Ubuntu – Using time -v to calculate execution time. Command not found

bashcommand linetime

I'm trying to measure the execution time of a C program I wrote. However, I want to see a detailed output of different times, percent of CPU use, etc. I try

time -v ./a.out

But I get an error that states the command -v was not found. However, I have checked the man pages for time and -v or --verbose is an option.

What's wrong?

Best Answer

That means the time that you are using is the bash shell built in time which the only option is -p and you cannot even use -V, instead use the actual command with specifying its full path:

/usr/bin/time -v ./a.out

the man page is for the above command that if you do which time, will see /usr/bin/time. For the bash built-in time, you can help time.

Further reading: