https://github.com/marosiak/easybenchmark
The easist way to check what's faster
https://github.com/marosiak/easybenchmark
Last synced: 3 months ago
JSON representation
The easist way to check what's faster
- Host: GitHub
- URL: https://github.com/marosiak/easybenchmark
- Owner: marosiak
- License: mit
- Created: 2018-09-10T17:34:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T12:39:37.000Z (over 6 years ago)
- Last Synced: 2025-01-03T16:24:59.673Z (5 months ago)
- Language: C++
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EasyBenchmark
I've made this project because I wanted to be able, to quickly and easy benchmark what's faster solution, I'm bored of using raw std::chrono, so this "lib" does it faster.
## Example
```c++
#include
#includeint main() {
// This is going to make some shit, to let us test performance
std::vector vector, cp;
for(int i=0; i<10000000; i++){
vector.push_back(9223372036854775807);
}Benchmark::start("iterator loop"); // optional argument
cp.clear();
for(unsigned int i=0;i();Benchmark::start("range-based loop");
cp.clear();
for( const auto& i : vector) { cp.push_back(i); }
Benchmark::end(); // optional template
}
```## Benchmark::start();
* optional argument ***std::string name***This is going to start the benchmark, as optional argument you can enter
## Benchmark::end();
* optional template ******
```c++
Benchmark::end(); // Default it's miliseconds
Benchmark::end();
```
This is going to end the test, and print message.
***example:***
```text
[Benchmark] "range-based loop" passed in 249240 us
```