An open API service indexing awesome lists of open source software.

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

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
#include

int 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
```