From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 88E85BB81 for ; Tue, 14 Dec 2004 21:39:26 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBEKdQ4s024927 for ; Tue, 14 Dec 2004 21:39:26 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA05846 for ; Tue, 14 Dec 2004 21:39:25 +0100 (MET) From: romildo@uber.com.br Received: from gentoo.malaquias.no-ip.org (233-139-232.xdsl-dinamico.ctbcnetsuper.com.br [200.233.139.232]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBEKdNJG024924 for ; Tue, 14 Dec 2004 21:39:24 +0100 Received: by gentoo.malaquias.no-ip.org (Postfix, from userid 500) id A0416193CA; Tue, 14 Dec 2004 18:43:47 -0200 (BRST) Date: Tue, 14 Dec 2004 18:43:47 -0200 To: Keith Wansbrough Cc: romildo@uber.com.br, caml-list@inria.fr Subject: Re: [Caml-list] Simple clock Message-ID: <20041214204347.GB26559@gentoo.malaquias.no-ip.org> Mail-Followup-To: Keith Wansbrough , romildo@uber.com.br, caml-list@inria.fr References: <20041214171716.GA10373@gentoo.malaquias.no-ip.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DKU6Jbt7q3WqK7+M" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce with ID 41BF4F7E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41BF4F7B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; romildo:01 caml-list:01 wrote:01 sugestions:01 compilation:01 ocamlopt:01 -thread:01 threads:01 cmxa:01 cmxa:01 referenced:01 usr:01 lib:01 ocaml:01 threads:01 X-Attachments: name="simple-clock.ml" X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=FORGED_RCVD_HELO,NO_REAL_NAME autolearn=disabled version=3.0.0 X-Spam-Level: --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 14, 2004 at 05:38:50PM +0000, Keith Wansbrough wrote: > > > > $ simpleclock > > 15:15:58 > > 15:15:59 > > 15:16:00 > > 15:16:01 > > > > I want to receive sugestions on how to implement > > this. > > Thread.delay > Unix.time > Unix.localtime I have tried the following program, but its compilation fails with the message: $ ocamlopt -thread threads.cmxa unix.cmxa simple-clock.ml -o simple-clock No implementations provided for the following modules: Unix referenced from /usr/lib/ocaml/threads/threads.cmxa(Thread) What does that mean? Romildo --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="simple-clock.ml" (* simple-clock.ml Repeatedly prints the current time at the standard output, at intervals of 1 sec How to compile: ocamlopt -thread threads.cmxa unix.cmxa simple-clock.ml -o simple-clock *) open Unix open Thread let print_tm tm = print_int tm.tm_hour; print_char ':'; print_int tm.tm_min; print_char ':'; print_int tm.tm_sec let simple_clock () = while true do print_tm (Unix.localtime (Unix.time ())); print_newline (); Thread.delay 1.0 done let _ = simple_clock () --DKU6Jbt7q3WqK7+M--