use Evo::Base -strict;
use Railway::Builder;
use Guard;
use Benchmark ':all';
use Time::Piece;

my ($start, $end, $dur);
my $bldr1 = Railway::Builder->new;
my $train1 = $bldr1->build_train;

my $N = 500_000;
# pure 2, 9

$start = localtime;
$train1->way->add(sub {@_})->add(sub {"foo"})->add(sub {"bad"}) for 1 .. $N;
$end = localtime;
$dur = $end - $start;
say "Build $N:, $dur";

$start = localtime;
$train1->start();
$end = localtime;
$dur = $end - $start;
say "Run $N:, $dur";

say "$N:, $dur";
