From d389569d63300a1acc19c230f99333a03e0f9f5a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 14 Aug 2011 13:18:40 +0100 Subject: Add manpage for benchmark-cmd. --- Makefile | 8 +++++++- benchmark-cmd.1.in | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 benchmark-cmd.1.in diff --git a/Makefile b/Makefile index 01515ee..413a6e1 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,15 @@ scripts = assert do-until errno minimify splitmboxdaily \ setuppy-debian-versions-match viewprof fix-shebang \ musictomp3 test-flacs unpack-debian-sources mksparse \ humanify benchmark-cmd +manpagesin = $(shell ls *.1.in) CFLAGS = -Wall -O2 --std=gnu99 -all: $(progs) +all: $(progs) manpages + +manpages: $(manpagesin) + for x in $(manpagesin); do cmd=$$(basename $$x .1.in); \ + ./$$cmd --generate-manpage=$$x > $$cmd.1; done install: all install -d $(DESTDIR)$(bindir) @@ -22,3 +27,4 @@ install: all clean: rm -f $(progs) *.o + for x in $(manpagesin); do rm -f $$(basename $$x .in); done diff --git a/benchmark-cmd.1.in b/benchmark-cmd.1.in new file mode 100644 index 0000000..275dc0c --- /dev/null +++ b/benchmark-cmd.1.in @@ -0,0 +1,42 @@ +.\" Copyright 2011 Lars Wirzenius +.\" +.\" This program is free software: you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. If not, see . +.\" +.TH BENCHMARK-CMD 1 +.SH NAME +benchmark-cmd \- benchmark shell commands +.SH SYNOPSIS +.SH DESCRIPTION +.B benchmark-cmd +benchmarks one or more Unix shell commands. +It runs some setup commands, +then the actual command, +and then some cleanup commands, +and can do this for several actual commands. +It then reports the timing results for each actual command. +.SH OPTIONS +.SH EXAMPLE +To see whether +.BR ls (1) +or +.BR find (1) +is faster: +.IP +.nf +$ benchmark-cmd --command='ls -lAR $HOME' \\ + --command='find $HOME -ls' +real user system max RSS elapsed cmd + (s) (s) (s) (KiB) (s) + 0.4 1.0 1.4 8608 1.4 ls -lAR $HOME + 0.4 0.4 0.8 8400 0.8 find $HOME -ls -- cgit v1.2.1