• 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: Timing some code execution outside Instruments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Timing some code execution outside Instruments


  • Subject: Re: Timing some code execution outside Instruments
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Thu, 21 Jul 2011 14:19:25 -0400

I found this.

NSDate *methodStart = [NSDate date];


/* ... Do whatever you need to do ... */

NSDate *methodFinish = [NSDate date];

NSTimeInterval executionTime = [methodFinish timeIntervalSinceDate:
methodStart];

  Google Voice: (508) 656-0622
  Twitter: eric_dolecki      XBoxLive: edolecki      PSN: eric_dolecki
  http://blog.ericd.net



On Thu, Jul 21, 2011 at 2:11 PM, Howard Siegel <email@hidden> wrote:

> Yes
>
>
> On Thu, Jul 21, 2011 at 10:59, Eric E. Dolecki <email@hidden> wrote:
>
>> I'm curious if there is a way to NSLog how long some code takes to execute
>> (outside of using Instruments).
>>
>> In Flash one can use getTimer and see how much time passed inline. Is
>> there
>> a way to do this in Obj-C?
>>
>> Would one use a NSDate object?
>>
>>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Timing some code execution outside Instruments (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Timing some code execution outside Instruments (From: Howard Siegel <email@hidden>)

  • Prev by Date: Cocoaheads- Silicon Valley July Meeting
  • Next by Date: Re: Native Cocoa API for iTunes?
  • Previous by thread: Re: Timing some code execution outside Instruments
  • Next by thread: Re: Timing some code execution outside Instruments
  • Index(es):
    • Date
    • Thread