From: Ville-Pertti Keinonen <will@exomi.com>
To: romildo@uber.com.br
Cc: Lars Nilsson <chamaeleon@gmail.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Simple clock
Date: Tue, 14 Dec 2004 23:52:51 +0200 [thread overview]
Message-ID: <1103061171.74797.23.camel@localhost> (raw)
In-Reply-To: <20041214203930.GA26559@gentoo.malaquias.no-ip.org>
On Tue, 2004-12-14 at 18:39 -0200, romildo@uber.com.br wrote:
> Particularly, the while, print_tm and print_newline execution
> time is not counted. Would that introduce an accurace in
> my clock? If so, is that inevitable?
It'll always print the correct time, at approximately one-second
intervals, but as you suspect, it'll drift over time.
What you probably want for the delay is something like:
ignore (Unix.select [] [] [] (1.0 -. (fst (modf (Unix.gettimeofday
())))))
Unix.gettimeofday () returns the time as a floating point number with
reasonable accuracy, modf splits it into fractional and integral parts,
fst selects the first one (the fractional part), so the select returns
at (or as close to as possible) the next integral second.
next prev parent reply other threads:[~2004-12-14 21:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-14 17:17 romildo
2004-12-14 17:38 ` [Caml-list] " Keith Wansbrough
2004-12-14 18:17 ` Lars Nilsson
2004-12-14 20:39 ` romildo
2004-12-14 21:52 ` Ville-Pertti Keinonen [this message]
2004-12-15 3:20 ` Kurt Welgehausen
2004-12-15 17:37 ` Evan Martin
2004-12-14 20:43 ` romildo
2004-12-15 3:00 ` skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1103061171.74797.23.camel@localhost \
--to=will@exomi.com \
--cc=caml-list@inria.fr \
--cc=chamaeleon@gmail.com \
--cc=romildo@uber.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox