multitime

Overview

multitime runs a command a user-specified number of times, and prints the timing means (averages), medians, and standard deviations (from time) having done so. It is a low-tech way of timing things while still providing some assurance that a) occasional usage spikes by other processes / users are not unduly distorting results b) if such spikes are frequent, distortions in the data can be spotted.

Download

Download the latest version.

multitime is part of my bin repository; you can track multitime's evolution via git.


Usage

The command-line arguments are as follows:
multitime <num_runs> <cmd> [<cmd args>]
Where: <cmd> is a number greater than or equal to 1; <cmd> is the command to run; and <cmd args> are arguments to pass straight to <cmd>. For example, if you wish to average 5 runs of the md5 -t command:
$ multitime 5 md5 -t
Means:     real 0.218 user 0.226 sys 0.000
Std. devs: real 0.004 user 0.008 sys 0.000
Medians:   real 0.22 user 0.22 sys 0.00

See also

The time man page.