[haiku-development] Re: [PATCH] Add microsecond resolution to BTime

  • From: julun <host.haiku@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 10 Oct 2008 00:55:54 +0200

Hi Stephen,

Stephen Deken schrieb:
On Thu, Oct 9, 2008 at 1:34 PM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:
AFAIK BTime is a private Haiku only class - it's always compiled into
the app that uses it (hence the shared folder), so you can freely
change it without fearing incompatibilities with BeOS.

Ah, that's much easier then.  Here's a revised, simpler patch that
throws caution to the wind.

I would also make the microsecond parameter of the constructor
optional, I think.

Yes, that was my original intent, but I was attempting to ensure
binary compatibility by not adding parameters to existing functions,
and not changing the size of the existing class.  Since that's not
necessary, the attached patch does make the microsecond parameter
optional.

I wonder if you really need such a fine grained resolution in that class, wouldn't milliseconds be enough for your purpose as well?

I had re-based the BTime class to only have a fMilliseconds member, so that i could easily add some functions like AddHours(...), AddMinutes(...) etc. Now i need to hold and maintain an additional member, since even a bigtime_t is not big enough to hold the microseconds per day.

Best regards,
Karsten

Other related posts: