List Info

Thread: How to get the time taken by a perl function in milliseconds?




How to get the time taken by a perl function in milliseconds?
country flaguser name
United States
2007-02-22 05:46:35
Hi all.

How can we get the time taken by a simple perl function in 
milliseconds.

to illustrate my problem better..see the following:

my time1 =
<some_in_built_function_to_get_time_in_millisconds>;
Calling_Simple_Perl_Function();
my time2 =
<some_in_built_function_to_get_time_in_millisconds>;
my totalTime = time2 - time1;

is there a built-in perl function to get time in
milliseconds? if 
there is any other alternative, pls suggest.

Thanks,
rock




------------------------ Yahoo! Groups Sponsor
--------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/0It09A/bOaOAA/yQLSAA/ndFolB/TM

------------------------------------------------------------
--------~-> 

 
Yahoo! Groups - Join or create groups, clubs, forums
&amp; communities. Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/Perl_Official/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/Perl_Official/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:Perl_Official-digest@yahoogroups.com 
    mailto:Perl_Official-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    Perl_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups - Join or create groups,
clubs, forums &amp; communities. is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: How to get the time taken by a perl function in milliseconds?
country flaguser name
United States
2007-02-22 18:30:26
>>>>> "rockmohit" == rockmohit 
<rockmohityahoo.co.uk> writes:

rockmohit> How can we get the time taken by a simple perl
function in 
rockmohit> milliseconds.

"perldoc Benchmark"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. -
+1 503 777 0095
<merlynstonehenge.com> <URL:http://www.ston
ehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy,
etc. etc.
See PerlTraining.Stonehenge.com for onsite and
open-enrollment Perl training!


 
Yahoo! Groups - Join or create groups, clubs, forums
&amp; communities. Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/Perl_Official/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/Perl_Official/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:Perl_Official-digest@yahoogroups.com 
    mailto:Perl_Official-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    Perl_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups - Join or create groups,
clubs, forums &amp; communities. is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: How to get the time taken by a perl function in milliseconds?
country flaguser name
United States
2007-02-24 04:05:50
Hi,

    You can can use:
    $time1=time();
     &fun;
    $time2=time();
   time() function returns epoch  value(mili seconds) of
current time.

For more time functions----------
 You can use perl module:         Time::Local
-- 
Regards,
Nawab Ahmad
Scientist/Engineer
ISRO Satellite Centre,
Dept. of Space,Govt. of India

On 2/22/07, rockmohit <rockmohityahoo.co.uk> wrote:
>
>   Hi all.
>
> How can we get the time taken by a simple perl function
in
> milliseconds.
>
> to illustrate my problem better..see the following:
>
> my time1 =
<some_in_built_function_to_get_time_in_millisconds>;
> Calling_Simple_Perl_Function();
> my time2 =
<some_in_built_function_to_get_time_in_millisconds>;
> my totalTime = time2 - time1;
>
> is there a built-in perl function to get time in
milliseconds? if
> there is any other alternative, pls suggest.
>
> Thanks,
> rock
>
>  
>


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor
--------------------~--> 
Great things are happening at Yahoo! Groups.  See the new
email design.
http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/ndFolB/TM

------------------------------------------------------------
--------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/Perl_Official/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/Perl_Official/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:Perl_Official-digest@yahoogroups.com 
    mailto:Perl_Official-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    Perl_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )