Latest 1.2.1
Homepage https://github.com/ahimahas/MethodTimeTracker
License Restricted
Platforms ios 8.0, requires ARC
Authors

MethodTimeTracker CocoaPods Platform

MethodTimeTracker is a module that can measure a time to spend in each method.

When can be used

If you felt that your application works a bit slow and you want to know where is the bottleneck in the code level, you are in the right place.

Method time tracker measures for each method that how much time they spend.
You can specify a single method you want to measure, or just check all methods in a class.

Sample result

Here is the result of measuring all methods in Sample project.
The return value is a time in second.

sameple screenshot

Installation

Use the CocoaPods

pod ‘MethodTimeTracker’

and import header file

#import <NSObject+MethodTimeTracker.h>

If you want to use MethodTimeTracker without setting CocoaPods, you can download codes in MethodTimeTracker folder directly and add it to your project.

How to use

  • Measure a single method
  • (instancetype)init {

    //! with method name in String value
    [self trackingMethod:@"viewDidLoad"];

    //! or with method name in Selector
    [self trackingMethodWithSelector:@selector(viewDidLoad)];
    }

  • Measure multiple methods
  • (instancetype)init {

    //! with method name in String value
    [self trackingMethods:@[@"viewDidLoad", @"privateMethod:"]];

    //! or with method name in Selector
    [self trackingMethodWithSelectors:@selector(viewDidLoad), @selector(privateMethod:), nil];
    }

  • Measure all methods in class
  • (instancetype)init {

    //! measure all methods
    [self measureAllMethodsTime];
    }

  • Want to show all measured time with sorted
    //! at a point that you want to see logs.
    //! The result will be shown sorted by desc order
    ...
    [self showTrackedMethodTimeLogs];
    ...

sameple screenshot

Release history: 1.2.1

  • bug fix when swizzling dealloc method

Latest podspec

{
    "name": "MethodTimeTracker",
    "version": "1.2.1",
    "summary": "Librariy to measure a time spend in each method",
    "homepage": "https://github.com/ahimahas/MethodTimeTracker",
    "license": "Restricted",
    "authors": {
        "ahimahas": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ahimahas/MethodTimeTracker.git",
        "tag": "1.2.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "SampleProject/MSMethodTimeTracker/MSMethodTimeTracker",
    "module_name": "MethodTimeTracker"
}

Pin It on Pinterest

Share This