From owner-freebsd-questions@FreeBSD.ORG Wed May 29 06:13:09 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49FE3ACC; Wed, 29 May 2013 06:13:09 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id EA723CE1; Wed, 29 May 2013 06:13:08 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.7/8.14.7) with ESMTP id r4T6Ctia060259 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 29 May 2013 07:13:03 +0100 (BST) (envelope-from matthew@FreeBSD.org) DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk r4T6Ctia060259 Authentication-Results: smtp.infracaninophile.co.uk/r4T6Ctia060259; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy) Message-ID: <51A59C60.3010709@FreeBSD.org> Date: Wed, 29 May 2013 07:12:48 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Michael Sierchio Subject: Re: BSD sleep References: <20130528230140.A5B396F448@smtp.hushmail.com> <51A541B5.3010905@gmail.com> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2IWTWOFKWKXRMQFOALULR" X-Virus-Scanned: clamav-milter 0.97.8 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Cc: Kenta Suzumoto , Joshua Isom , FreeBSD Questions , freebsd-current@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 06:13:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2IWTWOFKWKXRMQFOALULR Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 29/05/2013 05:59, Michael Sierchio wrote: > On Tue, May 28, 2013 at 4:45 PM, Joshua Isom wrote: >=20 >=20 >> You think it's trivial until you read this: >> >> http://infiniteundo.com/post/**25326999628/falsehoods-** >> programmers-believe-about-time >> >> > Some days have 86400 seconds, some have 86401. There is a provision fo= r > two leap seconds to be applied at once, but that hasn't ever happened. > Still, a truly correct clock, set to UTC, might someday read >=20 > 23:59:59 > 23:59:60 > 23:59:61 > 00:00:00 >=20 > How many seconds did that hour have? Right. The fact that on very rare occasions a minute may not have 60 seconds in it plus many other corner cases in calculating the current wall-clock time is an amusing irrelevance. First of all, sleep deals in local elapsed time, which is a well defined property even if the displayed wall-clock time would be all over the place due to DST changes or relativistic effects or whatever. In this case, I'd be pretty surprised if GNU sleep's algorithm was anything more complicated than to convert the stated time into seconds and then sleep that number of seconds. And to do that conversion, it wwould just define one minute as 60 seconds, one hour as 60 minutes, one day as 24 hours, one week as 7 days, perhaps one month as 30 days, one year as 365 days[*]. Sure, it's simplistic and unsophisticated, but as an engineering solution it's good enough for the vast majority of purposes. Cheers, Matthew [*] I haven't checked on GNU sleep, but (for example) this is exactly what dnssec-keygen(8) does. --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey ------enig2IWTWOFKWKXRMQFOALULR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlGlnGcACgkQ8Mjk52CukIxjWgCfYsDszXTxMIsq6GSIanZKaBfg VMkAn16VkWFmjQQlfnj6lXizS7EjCiC2 =sH69 -----END PGP SIGNATURE----- ------enig2IWTWOFKWKXRMQFOALULR--