Re: Timing some code execution outside Instruments

2011-07-22 Thread Andreas Grosam
On Jul 21, 2011, at 7:59 PM, Eric E. Dolecki 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

Timing some code execution outside Instruments

2011-07-21 Thread Eric E. Dolecki
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? Google Voice: (508) 656-0622 Twitter:

Re: Timing some code execution outside Instruments

2011-07-21 Thread Howard Siegel
Yes On Thu, Jul 21, 2011 at 10:59, Eric E. Dolecki edole...@gmail.com 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?

Re: Timing some code execution outside Instruments

2011-07-21 Thread vincent habchi
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? You can use the basic old std C routines like clock (). Vincent

Re: Timing some code execution outside Instruments

2011-07-21 Thread Eric E. Dolecki
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