jonasbn / perl-test-timer

Test::Timer - test module to test/assert response times
https://jonasbn.github.io/perl-test-timer/
Other
1 stars 8 forks source link

Regular expression for parsing time string can be avoided #21

Closed jonasbn closed 5 years ago

jonasbn commented 5 years ago

Issue Template

Description

According to the documentation for Benchmark, the timestr method can be given a format parameter, this can be used to avoid using a regular expression.

jonasbn commented 5 years ago

This prototype demonstrates:

#!/usr/bin/env perl

use strict;
use warnings;

use Benchmark;

my $t0 = Benchmark->new;

sleep(1);

my $t1 = Benchmark->new;

print timediff($t1, $t0)->real;

print "\n";

exit 0;

Output as a single integer

jonasbn commented 5 years ago

Now only a release remains