Right the comment of Mike is fair,
I don't know what you are doing (a lie), anyway your interest is to
know a time interval rather than a date

you should design a object with a referential start-time:

CFAbsoluteTime timeNow(void)
{
        return (CFAbsoluteTime) (CFAbsoluteTimeGetCurrent() -
kCFAbsoluteTimeIntervalSince1970);
// you have similar access thru Cocoa
}

and use only NSDate (rather than to play with it, it's also a main
memory consumer) to make a representation of this time interval at
(T), I think it will save you a lot of pain
for the next time... :)

Cheers!

On Fri, Mar 20, 2009 at 2:50 PM, Mike Abdullah
<cocoa...@mikeabdullah.net> wrote:
>
> On 20 Mar 2009, at 21:17, Charles E. Heizer wrote:
>
>> Thanks,
>> No it's just playing around right now. It would be nice to be able to
>> specify if you wanted NSDate to be sub-second or second precision based.
>>
>> Just as question, can NSDate be overridden to be second precision based?
>
> Theoretically yes. Practically, it would be a rather bad idea. 1 second is
> meaningful to you, but consider a completely different culture's calendaring
> system where "a second" is actually equivalent to 3 of ours seconds. What
> would second precision be then?
>
> The point is that you don't really want to test the equality of two dates.
> Instead you want to compare them like so:
>
> date1 >= date2
> date1 <= date2
>
> Or you want to know if they're roughly equal to each other. "Is date1 within
> 0.5 seconds of date2"
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/openspecies%40gmail.com
>
> This email sent to openspec...@gmail.com
>



-- 
-mmw
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to