ok, here is the issue I am having measuring the performance of a unix
process I am trying to execute
within perl. Within per because I want to use benchmark module to see
how long it takes to execute
this process.

Here is the code snippet:

#!/usr/bin/perl

use Benchmark;
# declare array
my @data;
# start timer
$start = new Benchmark;
system ("vcs -sverilog Bins.sv -ntb_opts dtm -R");
$end = new Benchmark;
# calculate difference
$diff = timediff($end, $start);
# report
print "Time taken was ", timestr($diff, 'all'), " seconds";

The issue is that perl reports: Time taken was  1 wallclock secs

I think this is because perl is launching the process (vcs) and exits
(or is it?) and
hence there is really no time consumed between start and end. Can someone
comment?

Regards

On Thu, Mar 20, 2008 at 6:58 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
>  > On Thu, Mar 20, 2008 at 9:15 AM, Sharan Basappa
>  > <[EMAIL PROTECTED]> wrote:
>  >> Thanks, this is really helpful. In addition, is there a way to print
>  >>  the cpu cycles taken from *ux command prompt?
>  >>  I have worked with tools that, at the end of their job, print out the
>  >>  cpu cycles it took for them.
>  >>  I would assume that they use some command from *ux to do this.
>  > snip
>  >
>  > The time command in UNIX will give you the amount of time the program
>  > took to run, the amount of cpu time the program took to run, and the
>  > amount of time spent on system overhead:
>  >
>  > time ./q.pl
>  >
>  > real    0m0.013s
>  > user    0m0.007s
>  > sys     0m0.006s
>
>  Or you could use the times() function built in to Perl.
>
>  perldoc -f times
>
>
>  John
>  --
>  Perl isn't a toolbox, but a small machine shop where you
>  can special-order certain sorts of tools at low cost and
>  in short order.                            -- Larry Wall
>
>
>
>  --
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>  http://learn.perl.org/
>
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to