title: How can the last command's wall time be put in the Bash prompt?
body: <p>Is there a way to embed the last command's elapsed wall time in a <a href="http://en.wikipedia.org/wiki/Bash" rel="noreferrer">Bash</a> prompt?  I'm hoping for something that would look like this:</p>
  
  <pre><code>[last: 0s][/my/dir]$ sleep 10
  [last: 10s][/my/dir]$
  </code></pre>
  
  <p><strong>Background</strong></p>
  
  <p>I often run long data-crunching jobs and it's useful to know how long they've taken so I can estimate how long it will take for future jobs.  For very regular tasks, I go ahead and record this information rigorously using appropriate logging techniques.  For less-formal tasks, I'll just prepend the command with <code>time</code>.  </p>
  
  <p>It would be nice to automatically <code>time</code> every single interactive command and have the timing information printed in a few characters rather than 3 lines.  </p>