SUSv3 who

Cathey, Jim jcathey at ciena.com
Tue Feb 3 22:50:31 UTC 2009


Using difftime can be perilous, if your environment
is not (yet?) totally floating-point friendly.  We
had exactly that problem, and ended up using the
POSIX suggestion to replace it.  (The MIPS family
offers an amusing variety of floating-point variations
to slog through...)

I generally avoid the use of floating point altogether
unless it is absolutely necessary.  Y'all may now feel
free to flame me for that.  It's just an opinion, but I
come by it honestly.

-- Jim



-----Original Message-----
From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]
On Behalf Of Denys Vlasenko
Sent: Tuesday, February 03, 2009 2:45 PM
To: busybox at busybox.net
Cc: Bernhard Reutner-Fischer
Subject: Re: SUSv3 who

Hi Bernhard,

Thanks for the review.

On Tuesday 03 February 2009 19:19, Bernhard Reutner-Fischer wrote:
> >	t = time(NULL) - st.st_atime;
> 
> difftime()

Interesting, didn't know about this function...

       #include <time.h>
       double difftime(time_t time1, time_t time0);
...
       This  function  is required by ANSI C.  On a POSIX system, time_t
is an
       arithmetic type, and one could just define
              #define difftime(t1,t0) (double)(t1 - t0)

Doesn't look too encouraging.
--
vda
_______________________________________________
busybox mailing list
busybox at busybox.net
http://lists.busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list