Before and after adding an index, I want a number. psql can print one after every statement.
appdb=# \timing on
Timing is on.
appdb=# SELECT count(*) FROM orders WHERE customer_id = 42;
count
-------
17
Time: 1.943 ms
The time is in milliseconds, and longer runs also get a minutes and seconds part. \timing without an argument toggles it, \timing off turns it off.
It measures the whole round trip as psql sees it: sending the query, the server doing the work, and the result coming back over the network. That makes it different from EXPLAIN ANALYZE, which reports the time inside the server only. A query returning 100000 rows can show a long time here while the server part was quick, because most of it went into transferring and printing rows.
Run a query twice and look at the second time. The first run often reads from disk and the second from cache, and the difference can be large. Compare like with like: same data, same cache state, and preferably a few runs each. To have it on in every session, put \timing on in ~/.psqlrc.
Further reading: psql (\timing)