Question about TIMEOUT applet.

Harald Becker ralda at gmx.de
Tue Jul 16 22:39:33 UTC 2013


Hi,

here is a first version of a duration helper function. As
Bernhard suggested, it always works with float (double) values,
but if required we can add a version using only integers and the
bare minimum of required suffixes (d, h, m, s).

The current version allows for the following suffixes:

  w = weeks
  d = days
  h = hours
  m = minutes
  s = seconds (default if no suffix)
  u = microseconds
  n = nanoseconds

In addition it understands fancy combined duration specifications
like:

  '1m15s'
  '1s100u'
  '1h+5m'
  '1h-5m+15s'
  '0.5m+5s'

GNU libc even allows for hexadecimal values:

   0xFFFF -> 65535 seconds


This is a first version, looking for comments.

--
Harald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strtots.c
Type: text/x-csrc
Size: 2759 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20130717/fae0eb3b/attachment.c>


More information about the busybox mailing list