time a command

How long a command takes, and how much memory and processor it used.

  • development
  • processes

Steps

  1. time command

    real is the clock time; user and sys, the processor's

  2. /usr/bin/time -v command

    also its peak memory (GNU time)

  3. hyperfine 'command'

    run it many times for a fair figure (hyperfine)

Notes

  • real much bigger than user + sys means it was waiting: the disk, the network or you.

Commands used

  • time
  • hyperfine

Each has a page in lore: lore time opens it.