• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: needed Time for a method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: needed Time for a method


  • Subject: Re: needed Time for a method
  • From: Paul Ferguson <email@hidden>
  • Date: Mon, 23 Sep 2002 08:26:18 -0700

Here's a handy function to get millisecond accurate timestamps using the kernel UpTime() function, which avoids the overhead of NSDate.

#import <DriverServices.h>
unsigned int UpTimeInMilliseconds()
{
unsigned int result;
Nanoseconds n = AbsoluteToNanoseconds(UpTime());
unsigned long long int i = n.hi;
i <<= 32;
i += n.lo;
i /= 1000000;
result = i;
return result;
}

See also the documentation at MP.97.html (search for "UpTime" documentation in Project Builder) for more code to create very accurate timestamps.


On Friday, September 20, 2002, at 04:18 PM, Claudius Sailer wrote:

I want to know the time how long a method takes and I found for that

(NSTimeInterval)timestamp

but I can't use it because I am to stupid. How I get the value from this?
_______________________________________________
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.

  • Follow-Ups:
    • Re: needed Time for a method
      • From: Pierre-Olivier Latour <email@hidden>
References: 
 >needed Time for a method (From: Claudius Sailer <email@hidden>)

  • Prev by Date: Re: Problem killing my threads :)
  • Next by Date: Re: Licences 101 - Copy Protection for Newbies
  • Previous by thread: Re: needed Time for a method
  • Next by thread: Re: needed Time for a method
  • Index(es):
    • Date
    • Thread