Re: Time taken by a script
Debian Linux User wrote: Since Perl is an interpreted language No, perl is a compiled language, with a 3 pass compiler. man perlguts\n/compiled code -- see shy jo
Re: Time taken by a script
Ron Rademaker wrote: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null addendum: you can run CGI scripts in offline mode and feed them their form variables through standard intput or command line args. so do something like $bashtime foo.cgi key=valuekey1=value and that will spit back some execution times. Do that alot for an average. Justin
Re: Time taken by a script
Ron Rademaker wrote: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null Since Perl is an interpreted language, there are no assurances as to how long it will take to run your script, because it highly dependent on how Perl decides to process your instructions. CGI scripts typically are under their own process anyhow, so it also depends on when the OS decides to schedule your script for execution. Since Linux is not a Real Time OS there are no assurances on either front. The point being that you can get a pretty good average (down to a tenth of a second) in testing, but execution time may widly vary under a heavy system load. Solution: Average time under a heavy load and feel comfortable with an average. Justin
Re: Time taken by a script
Ron is rights, but you can get an idea when you do prepend the time command like: time script It gives you a few stats. Regards, Onno At 06:19 AM 3/23/00 +, Debian Linux User wrote: Ron Rademaker wrote: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null Since Perl is an interpreted language, there are no assurances as to how long it will take to run your script, because it highly dependent on how Perl decides to process your instructions. CGI scripts typically are under their own process anyhow, so it also depends on when the OS decides to schedule your script for execution. Since Linux is not a Real Time OS there are no assurances on either front. The point being that you can get a pretty good average (down to a tenth of a second) in testing, but execution time may widly vary under a heavy system load. Solution: Average time under a heavy load and feel comfortable with an average. Justin -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null
Re: Time taken by a script
I have yet to use this module, but I was just reading about it in the Camel book. $ perldoc Benchmark brian On Mon, Apr 17, 2000 at 04:44:17PM +0200, Ron Rademaker wrote: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null -- Brian Lavender http://www.brie.com/brian/
Re: Time taken by a script
On Fri, Mar 17, 2000 at 11:30:21PM +0530, Chirag wrote: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron I guess time can do it But not sure. Pls consult the manpage of time Previ man Benchmark It's one of the core modules in the perl distribution. It's designed to do exactly what you want, shows user and sys times. There's a plethora of options to do any conceivable test you want. -- Regards, Paul
Time taken by a script
I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron
Re: Time taken by a script
Ahoy You ask: I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Here's a crude way: #!/usr/bin/perl $now = time(); for( i=0; i10; i++) { require(thescriptIwanttotime.pl); } $then = time(); $elapsed = (($then - $now) / 10); print $elapsed; exit; Aloha Davis
Re: Time taken by a script
- Original Message - From: Ron Rademaker [EMAIL PROTECTED] To: debian-user@lists.debian.org Sent: Monday, April 17, 2000 8:14 PM Subject: Time taken by a script I've written a cgi script in perl an I would like to know how long (exactly, 10th of second) it takes to execute the script, how can I do this? Ron I guess time can do it But not sure. Pls consult the manpage of time Previ -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null