NAME

Benchmark::OO - Simple interface to do benchmarking.

SYNOPSIS

use Benchmark::OO;

#Start benchmarking here
my $obj = Benchmark::OO->start();

for(my $i = 0; $i < 20000000; $i++) {
    
}

#Stop benchmarking here
$obj->stop();

#To print benchmark
$obj->print_benchmark();

#To get benchmark hash reference
my $ret = $obj->get_benchmark();
require Data::Dumper;
print Data::Dumper::Dumper($ret);

DESCRIPTION

This is a simple benchmarking module, can be used to get the banchmark any part of code or complete code.

start

This function will start benchmarking.

stop

This function will stop benchmarking.

This function will print benchmark result. Below is example:

Start Datetime: Sep 21 2013 22:37:39
Start second epoch: 1379783259
Start Microsecond epoch: 735328
End Datetime: Sep 21 2013 22:37:42
End second epoch: 1379783262
End Mocrosecond epoch: 755713
Total time taken: 3 seconds 20385 microseconds
stop

This function will return anonymous hash reference of benchmark result. Below is an example:

{
    'START_DATETIME' => 'Sep 21 2013 22:37:39',
    'TAKEN_MICROSEC' => 20385,
    'END_MICROSEC' => 755713,
    'END_SEC' => 1379783262,
    'START_SEC' => 1379783259,
    'END_DATETIME' => 'Sep 21 2013 22:37:42',
    'TAKEN_SEC' => '3',
    'START_MICROSEC' => 735328
}

AUTHOR

Vipin Singh, <qwer@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2013 by Vipin Singh

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