You can use printf or sprintf to control the format, but what you are doing
is called profiling and it is better to use an actual profiler. Take a look
at Devel::NYTProf

http://search.cpan.org/~timb/Devel-NYTProf-6.04/lib/Devel/NYTProf.pm

https://www.perl.org/about/whitepapers/perl-profiling.html

On Wed, May 24, 2017, 22:12 SSC_perl <p...@surfshopcart.com> wrote:

>         I’m timing sub routines to get an idea of where my scripts spend
> the most of their time.  This is an example of what I’m doing:
>
> use Time::HiRes qw( clock );
> my $clock0 = clock();
> ... # Do something.
> my $clock1 = clock();
> my $clockd = $clock1 - $clock0;
>
>         I’m getting values like $clock1 = 0.030259 and $clock0 =
> 0.030212.  However, instead of $clockd being 0.000047, it’s returning
> 4.70000000000019e-05.  I take it that’s exponential notation (?) but it’s
> actually more difficult to read than the regular number.  Is there a way to
> get it to print out differently?
>
> Thanks,
> Frank
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to