Feature #29


"timed_run" library function

Added by Mikhail Yakshin 3180 days ago. Updated 3175 days ago.

Status:Closed Start:07/08/2009
Priority:Normal Due date:
Assigned to:avatarSergey Matveev % Done:


Target version:3.2


We have the same algorithm implemented in several places: for some tests we do benchmarking using a "dumb" wall clock timing, using time command.

A proposal is to make a "timed_run" library function that does the following:

  • gets the target command (with full options, etc) to measure in $@
  • runs this command under time, redirects its stdout and stderr in $DEBUG_TTY
  • checks exit code — fails current test if there was an error
  • gathers the data from time
  • cuts wall clock from them and outputs it in stdout
  • does proper garbage collecting (i.e. deletes temporary files, etc)

This way, most of encoding tests, for example, could be reduced to simple one call:

benchmark_submit_float \
    'Encoding time' \
    "`timed_run flac -$COMPRESSION_LEVEL -f -o /dev/null $SOURCE`" \


Updated by Sergey Matveev 3175 days ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF