From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA05034; Thu, 23 Aug 2001 19:35:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA05061 for ; Thu, 23 Aug 2001 19:35:55 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f7NHZrH01907; Thu, 23 Aug 2001 19:35:53 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA05121; Thu, 23 Aug 2001 19:35:52 +0200 (MET DST) Date: Thu, 23 Aug 2001 19:35:52 +0200 From: Xavier Leroy To: "Krishnaswami, Neel" Cc: caml-list@inria.fr Subject: Re: [Caml-list] time complexity on basic data types Message-ID: <20010823193552.A32344@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from neelk@cswcasa.com on Thu, Aug 23, 2001 at 01:27:45PM -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > What facilities exist for timing constructs in Caml? I see > > val times : unit -> process_times > > in the manual, under unix system calls. The most portable way to time a piece of code is via the Sys.time() function. It's part of the OCaml standard library, so it's guaranteed to work on all ports of OCaml -- even non-Unix ones. The Unix.times() function is more Unix-specific and is provided by an external library, which you have to request explicitly (as Neel explained). > Second, > for reasons I don't understand the Unix library is not linked by > default, The main reason is that it might not be available (on a non-Unix platform, for instance). (OK, both the Windows and the MacOS ports of OCaml have reasonable Unix emulation built-in, but that wasn't always the case, and hypothetical ports to other OSes might not have it either.) In other terms, the modules that are linked by default, that is, those in the standard library, are the modules that are available everywhere; other modules are in separate libraries, not linked in by default. > In addition to this, you can also use the nice profiler that comes > with the OCaml distribution, which gives you all sorts of fancy > instruction counts. That's in chapter 16 of the Caml manual: > Correct. There's also the option of using ocamlopt -p in conjunction with the Unix profiler "gprof". - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr