App-mdee

 view release on metacpan or  search on metacpan

xt/nofork.t  view on Meta::CPAN

    skip "$test_md not found", 1 unless -f $test_md;

    my $n = $opt{count};
    my $big_md = _make_big_md($test_md, 10);

    # Estimate time with a single run of each mode
    my $t_nofork = _wallclock(sub { run("'-Mmd::config(table=1,rule=1)' $big_md") });
    my $t_fork   = _wallclock(sub { run("'-Mmd::config(table=1,rule=1,nofork=0)' $big_md") });
    my $est = ($t_nofork + $t_fork) * $n;
    diag "";
    diag sprintf "Benchmark: %d iterations, 10x tables (est. %.0f sec)", $n, $est;

    my $done = 0;
    my $total = $n * 2;
    my $started = time;

    my $progress = sub {
	$done++;
	my $elapsed = time - $started;
	my $remain = $done > 0 ? $elapsed / $done * ($total - $done) : 0;
	printf STDERR "\r  [%d/%d] %.0f sec remaining ...  ", $done, $total, $remain;



( run in 1.149 second using v1.01-cache-2.11-cpan-96521ef73a4 )