Latest 1.0.1
Homepage https://github.com/AlexandrGraschenkov/AGBenchmark
License MIT
Platforms ios 5.0, requires ARC
Frameworks Foundation
Authors

This is simple library for benchmark your ObjC, Swift and C++ code. You can watch how much time your code is spend. Some times algorithms begin work longer during the time. AGBenchmark also records this information.

For check how long the part of your code is executed, simple call:

Obj-C
AG_BENCHMARK(@"Sort algorithm") {
    [arr sortUsingSelector:@selector(compare:)];
}
C++

“`c++
AG_BENCHMARK("Sort algorithm") {
[arr sortUsingSelector:@selector(compare:)];
}


###### Swift
```swift
AGBenchmarkBlock("Sort algorithm") {
    arr.sortUsingSelector("compare:")
}

And then call [AGBenchmark logBenchmarkInfo]. Or you can call this method in timer:

ObjC
[NSTimer scheduledTimerWithTimeInterval:5.0 target:[AGBenchmark class] selector:@selector(logBenchmarkInfo) userInfo:nil repeats:YES];

In result you will get in log something like this:

(17:57:53.399) Benchmark:
"Default sort algoritm": total: 2.039; average: 0.005526; last 10 times avg: 0.005344; call times: 369;
"Insertion sort algoritm": total: 1485.237; average: 4.035970; last 10 times avg: 3.960172; call times: 368;

Contact

Alexandr Graschenkov: [email protected]

License

AGBenchmark is available under the MIT license.

Copyright © 2015 Alexandr Graschenkov.

Latest podspec

{
    "name": "AGBenchmark",
    "version": "1.0.1",
    "summary": "Small library for easy benchmark your ObjC, Swift and C++ code",
    "description": "I use it for benchmark part of algorithm writed on C++. Unforteniatly did't find any library for this purpose. Hope thap library will help somebody.",
    "homepage": "https://github.com/AlexandrGraschenkov/AGBenchmark",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Alexandr Graschenkov": "[email protected]"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/AlexandrGraschenkov/AGBenchmark.git",
        "tag": "v1.0.1"
    },
    "source_files": "AGBenchmark/**/*.{h,m,mm}",
    "requires_arc": true,
    "frameworks": "Foundation",
    "libraries": "c++"
}

Pin It on Pinterest

Share This