Performance Utilities and Tools

Measure the time of program execution

The time command in Linux is used to determine the duration of execution of a Go binary program. The time command returns, three(3) results are displayed:

  • real time – the total execution time. This is the time elapsed between invocation and termination of the command.
  • user CPU time – the CPU time used by your process.
  • system (sys) CPU time – the CPU time used by the system on behalf of your process.

# time go.binary.program

real 0m0.001s
user 0m1.021s
sys  0m0.000s


Profiling Go Code

Profiling is a practice that can be used to measure the resources utilized in a computer system. Profiling is often done to understand the CPU or memory utilization within a program in order to optimize for execution time, size, or reliability.

Articles of Go Profiling

Profiling with go test command


go test [build/test flags] [packages] [build/test flags & test binary flags]

Performance Utilities and Tools

Linux Performance Tools