Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/bin/sleep



    Date:        Sun, 27 Jan 2019 21:07:22 -0800
    From:        "Tom Spindler (moof)" <dogcow%babymeat.com@localhost>
    Message-ID:  <20190128050722.GA37731%babymeat.com@localhost>

  | I'd argue that "300ms" or "120us" or "15ns" are all pretty unambiguous,
  | and that an exactly two char suffix would be rather unlikely to be line
  | noise.

Probably, though in the linux version, 300m would mean 300 minutes
(I don't know if they go to check that there isn't another char following).

Sleeps for < 1 second are comparatively rare, as the internal mechanisms
don't work (currently anyway) at the kind of precision needed to support
it, so all that is really possible reliably is "very short" "short" or seconds,
which for the vast majority of purposes that the sleep command is used
is entirely sufficient (aside from the actual duration of the sleep, there are
also potential scheduelling delays before the process will get to run again.)

I don't think we really need to support any of this suffix stuff in the sleep
command, if needed it is easy to do the calculations on the command line,
I do things like
	sleep $(( 3600 * 3 + 60 * 20 ))
all the time, it really isn't that hard, and a script or function which would
look at the args (whatever are suitable for your use) and to the calculation
for you is, IMO, a better solution than building someone's idea of what
ought to be supported, and how it should work, into sleep.

kre



Home | Main Index | Thread Index | Old Index