softlab-ntua/bencherl — pull request #12 by davidklaftenegger (2013-02-19 18:03:54+00:00)
Title:  support for timing of sub-benchmarks

This patch does not change anything for existing benchmarks, but allows new ones to gather timings of only parts of an erlang program. This allows setup code to be reused, setup steps to be interleaved with measurements, and measuring several parts of a program. For example, one could measure separately on a database application the times for a block of inserts, a block of lookups and a block of deletions.

If a benchmark returns a tuple {{Code,Name}, Status} it will react as follows:
If Name is the atom 'ignored' the benchmark just measured is not recorded, otherwise it is recorded with Name as a tag in front of its parameter list.
Execution ends if Code is the atom 'done', and another benchmark will be started with Status as its argument if it is 'continue'.