in reply to Re: getting ping output using Net::Ping
in thread getting ping output using Net::Ping

I guess the important bit is #5. I'd like be able to say it took X ms. How do I time a call to a method? I have never done that before.
- Nick
  • Comment on Re: Re: getting ping output using Net::Ping

Replies are listed 'Best First'.
Re: Re: Re: getting ping output using Net::Ping
by SpongeBob (Novice) on Dec 18, 2001 at 05:30 UTC
Re: Re: Re: getting ping output using Net::Ping
by BrentDax (Hermit) on Dec 18, 2001 at 09:21 UTC
    use Time::HiRes 'time'; my $before=time(); #do stuff here my $after=time(); my $howlong=$after-$before;
    Note, however, that Time::HiRes returns the time in floating-point seconds, not milliseconds.

    =cut
    --Brent Dax
    There is no sig.