Re: Time elapsed how-to ?
Re: Time elapsed how-to ?
- Subject: Re: Time elapsed how-to ?
- From: Francis bouchard <email@hidden>
- Date: Mon, 13 May 2002 18:10:20 -0400
On 13/05/02 13:47, "Erik M. Buck" <email@hidden> wrote:
>
NSTimeInterval _myStartTime = [NSDate timeIntervalSinceReferenceDate];
>
>
NSTimeInterval _currentTime;
>
>
// do something time consuming
>
>
_currentTime = [NSDate timeIntervalSinceReferenceDate];
>
printf("The time it took: %d\n", currentTime - myStartTime);
>
>
This has sub-millisecond accuracy.
For the record, NSTimeInterval (returned by timeIntervalSinceReferenceDate)
if a double so to output if properly, use %f ;)
Took me a little while to find out!
Francis
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.