Scroll to navigation

Benchmark::ProgressBar(3pm) User Contributed Perl Documentation Benchmark::ProgressBar(3pm)


Benchmark::ProgressBar - Display Progress Bar While You Wait For Your Benchmark


  use Benchmark::ProgressBar qw(cmpthese);
  cmpthese(10_000, {
    a => sub { ... },
    b => sub { ... },
  } );


This is a VERY crude combination of and Term::ProgressBar. Basically I got sick of waiting for my benchmarks to finish up without knowing an ETA.

You can use it as a drop-in replacement for, but the only functions that would display a progress bar are the ones listed here: cmpthese, timethese, and timeit.

This is achieved via crude (a VERY crude) re-definition of's subrountines, so you shouldn't be mixing it with (I don't know why you would)

It does the job for me, YMMV. Patches are welcome.


Copyright (c) 2008 Daisuke Maki ""


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


2018-02-10 perl v5.26.1