Search code examples
timesprite-kitswift2performance-testing

Swift - function wise time consumption tracking


I want to performance test my code for an app coded in swift using SpriteKit. Is there a swift feature that I can use to track my code execution and obtain the following details.

  1. List of functions executed by my code.
  2. The number of times each function executed?
  3. Total time consumed by each function across all invocation of that specific function.
  4. Highest time consumed by each function during a specific invocation of that function.

Thanks


Solution

  • These features are available in Xcode as a separate app called "Instruments":

    https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/

    Instruments is a powerful and flexible performance-analysis and testing tool that’s part of the Xcode tool set. It’s designed to help you profile your OS X and iOS apps, processes, and devices in order to better understand and optimize their behavior and performance.