Track time a command takes on the console

Track time a command takes on the console

I wanted to track the time two php documentation generation tools need for the complete generation. Both generators are triggered on the console, so I searched for a console command. Of course there already is a basic UNIX one. It's called time.

This is the basic usage:

$ time [options] command [arguments...]

The following example tracks the time ApiGen takes for the generation:

$ time apigen generate
Found 479 classes, 0 constants and 0 functions
Generating API documentation
100 % - Finished!

real   2m11.603s
user   2m5.636s
sys    0m1.196s