Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2013 18:45:57 -0500
From:      Joshua Isom <jrisom@gmail.com>
To:        Kenta Suzumoto <kentas@hush.com>
Cc:        freebsd-current@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: BSD sleep
Message-ID:  <51A541B5.3010905@gmail.com>
In-Reply-To: <20130528230140.A5B396F448@smtp.hushmail.com>
References:  <20130528230140.A5B396F448@smtp.hushmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/28/2013 6:01 PM, Kenta Suzumoto wrote:
> Hi. Is there no built-in way of making "sleep" sleep in increments
> of minutes, hours, etc? The GNU "sleep" can be invoked like "sleep
> 1h" for an hour. The FreeBSD one's manpage leads me to believe we
> can only use seconds, which is kind of annoying. Is there an
> undocmented or missing feature here? Seems really trivial to
> implement.
>
> ~ $ sleep 1h
> usage: sleep seconds
>

You think it's trivial until you read this:

http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time

If you sleep one hour, do you sleep one hour from now or one hour from 
the system clock which may change in the next hour?  If it's the system 
clock, you may sleep for ten minutes or ten hours.  If you need to sleep 
for 3600 seconds, that's simple and understandable.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51A541B5.3010905>