| Karim Belabas on Mon, 03 Apr 2006 17:15:09 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: elapsed time and system command |
* Bill Allombert [2006-04-03 15:55]:
> 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.
I made this a FAQ item.
http://www.math.u-bordeaux.fr/~belabas/pari/doc/faq.html#systemtime
Using CVS version (from 10 minutes ago), you can abbreviate the above to
Configure --time=ftime
Cheers,
K.B.
P.S: There was a bug in Configure that prevented 'ftime' to be detected.
(Was not a problem since getrusage or times was always detected, and
prefered.)
--
Karim Belabas Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation http://www.math.u-bordeaux.fr/~belabas/
F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP]