Re: Timing Curry programs

From: Michael Hanus <mh_at_informatik.uni-kiel.de>
Date: Fri, 20 Oct 2017 09:55:16 +0200

Hi James,

if you want to implement the timing inside your code,
you could also use the system library `Time`

http://www-ps.informatik.uni-kiel.de/kics2/lib/Time.html

which provides access to current clock time etc.
However, one has to be careful w.r.t. lazy evaluation
so that you really time the right things.
Thus, the method described by Sandra is usually the
preferred one.

Best regards,

Michael

On 10/20/2017 09:05 AM, Sandra Dylus wrote:
> Hi James,
>
> On 20 Oct 2017, at 00:15, James Koppel <jkoppel_at_mit.edu> wrote:
>
>> How do time Curry programs? I'm looking through the KiCS2 documentation, and I can't find any way to get the current system time (ifI want to time it internally), nor accept a command-line argument (if I want to use the time command).
>
> if you’re using the REPL, you can set the timing option with “:set +time”. In the case, you want to execute just one specific function, you can use the combination of `:load`, `:eval` and `:quit` as suggested in the manual.
>
> > kics2 :load Module.curry :set +time :eval main :quit
>
> However, because of some formatting options, AFAIK, only ubuntu systems are supported — at least it does not work for MacOS. As an alternative, you can generate an executable and then use your preferred timing command.
>
> > kics2 :load Module.curry :save :quit
> > time .curry/kics2/Main
>
>> I want to do this because, I have a new approach to implementing direct-style nondeterminism in imperative languages, and I'd like to compare to the "built-in" nondeterminism of Curry.
>
> I’d be interested to hear about your results ; )
>
> Cheers
> Sandra

_______________________________________________
curry mailing list
curry_at_lists.rwth-aachen.de
https://mailman.rwth-aachen.de/mailman/listinfo/curry
Received on Fr Okt 20 2017 - 09:56:07 CEST

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:12 CET