cino hilliard on Tue, 04 Apr 2006 02:04:27 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: elapsed time and system command





From: Bill Allombert <allomber@math.u-bordeaux.fr>
To: pari-users@list.cr.yp.to
Subject: Re: elapsed time and system command
Date: Mon, 3 Apr 2006 15:46:43 +0200

On Sun, Apr 02, 2006 at 07:19:35AM +0000, cino hilliard wrote:
> The timing functions # and ## do not account for the time taken by calls to
> external objects.
> For example,
>
> (01:06) gp > #
>   timer = 1 (on)
> (01:05) gp > t(n) = for(x=1,n,write("testtimer.txt","12345678901"))
> (01:07) gp > t(100000)
> time = 10,891 ms.
> (01:08) gp > ##
>  ***   last result computed in 10,891 ms.
>
> Actually took 50 sec.
>
> This has been the case for some time and applies to system commands also.

Actually, PARI support three timing functions, times, ftime and
getrusage, getrusage being the default because this is the most reliable
and reproducible. getrusage report user time, not system or
wallclock time.

If you really want wallclock time, edit pari.cfg and change
has_getrusage='yes' to has_ftime='yes' and run
./Configure -l pari.cfg
make clean
and rebuild PARI.

? system("sleep 5");
? ##
  ***   last result computed in 5,081 ms.

Cheers,
Bill.
I am usint the windows binary.

Gee I wish I knew how to compile my own Pari and your gp2c program. every thing I try in
windows xp pro ka bonks.

Thanks anyway. I will use the windows clock or I will call a timer function with the system command.

Cheers and Roebuck,
Cino