How to see method execution time in XCode?
Time Profiler is a System Instruments which will tell you where the CPU is spending most of its time.
The Time Profiler instrument stops a Mac OS X program at prescribed intervals and records the stack trace information for each of the program’s threads. You can use this information to determine where execution time is being spent in your program and improve your code to reduce running time. Unlike many instruments, Time Profiler does not require DTrace probes in order to function. Time Profiler operates on a single process or all processes.
During sampling, this instrument captures the following information:
- The time at which sampling began
- The sampling duration
- Stack trace information (including the library and caller information)
- The maximum stack depth encountered during sampling
- The function encountered most frequently during sampling (the hot frame)
Apart from Time Profiler one can also use Sampler instrument which generally stops a program at prescribed intervals and records the stack trace information for each of the program’s threads. You can use this information to determine where execution time is being spent in your program and improve your code to reduce running time.
The main difference between sampler & Time profiler :
Sampler instrument operates upon a single process but Time Profiler operates upon a single/All processes.
No comments:
Post a Comment