[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] Re: [Axiom-mail] Help with AXIOM
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] Re: [Axiom-mail] Help with AXIOM |
Date: |
09 Jan 2004 21:51:57 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Are you looking for the GCL function (si::gbc-time)? (See gcl-si docs
for more info).
Take care,
David MENTRE <address@hidden> writes:
> Hello Elias,
>
> I would prefer that you publicly ask on axiom-mail mailing list, it
> would probably help other people.
>
> "Elias P. TSIGARIDAS" <address@hidden> writes:
>
> > I have the code that i append you at the end of the email
> >
> > i compile the code
> >
> > )compile timer.spad
> >
> >
> > but the i can not understand how to call the functions....
> >
> >
> > i have a function say foo()
> > How can i time it with runFunction() ??
>
> (1) -> )compile timer.spad
> [...]
> (1) -> foo () == 1 + 2
> Type: Void
> (2) -> runFunction(foo, 3)
> Compiling function foo with type () -> PositiveInteger
>
> >> System error:
> GCTIME is invalid as a function.
>
> protected-symbol-warn called with (NIL)
>
>
> However, it appears that your package call a lisp fonction GCTIME that
> does not exists, at least in GCL. Sorry, I can't help on that. I have
> googled but found nothing.
>
> I include gcl-devel in copy, maybe somebody there can be of some help
> for your issue.
>
> Why don't you use standard Axiom functions for timing? Need to store the
> result?
>
> Yours,
> d.
>
> > --- code for timer.spad
> >
> >
> >
> > )ab package TIMER NewTimingFunctions
> >
> > NewTimingFunctions : PUB == PRIV where
> >
> > PUB == with
> > totalTime : () -> Integer
> > ++ Total counting time in milliseconds
> > gcTime : () -> Integer
> > ++ Gc counting time in milliseconds
> > evaluationTime : () -> Integer
> > ++ Evaluation counting time in milliseconds
> >
> > PRIV == add
> >
> > totalTime () ==
> > evaluationTime() + gcTime()
> >
> > evaluationTime () ==
> > (GET_-INTERNAL_-RUN_-TIME()$Lisp) pretend Integer
> >
> > gcTime () ==
> > (GCTIME()$Lisp) pretend Integer
> >
> >
> > )ab package RUNF RunFunction
> >
> > RunFunction(Dom:SetCategory) : PUB == PRIV where
> >
> > PUB == with
> >
> > runFunction : ((()->Dom),Dom) -> Integer
> > doRun : ((()->Dom),Dom,String) -> Void
> > mapRun : (List(()->Dom),Dom,String) -> Void
> >
> > PRIV == add
> >
> > mapRun(lf,res,mes) ==
> > for f in lf repeat
> > t := totalTime()$NewTimingFunctions
> > runRes := f()
> > (runRes = res) =>
> > s : String := convert(totalTime()$NewTimingFunctions -t)$Integer
> > messagePrint(concat([mes, " in ", s ]))$OutputForm
> > messagePrint(concat(mes, " Bad result"))$OutputForm
> >
> > doRun(f,res,mes) ==
> > t := totalTime()$NewTimingFunctions
> > runRes := f()
> > (runRes = res) =>
> > s : String := convert(totalTime()$NewTimingFunctions -t)$Integer
> > messagePrint(concat([mes, " in ", s ]))$OutputForm
> > messagePrint(concat(mes, " Bad result"))$OutputForm
> >
> > runFunction(f,res) ==
> > t := totalTime()$NewTimingFunctions
> > runRes := f()
> > if runRes = res
> > then ( messagePrint("foo")$OutputForm ;
> > totalTime()$NewTimingFunctions -t)
> > else 0
> >
> >
> >
>
> --
> address@hidden
>
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah