Comparing version 1.0.8 to 1.0.9
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"main": "src/main.mjs", | ||
@@ -8,0 +8,0 @@ "types": "src/main.d.mts", |
@@ -25,11 +25,19 @@ <h1 align=center>mitata</h1> | ||
<table> | ||
<tr> | ||
<th>javascript</th> | ||
<th>c++ single header</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
```js | ||
import { run, bench, boxplot } from 'mitata'; | ||
function fibonacciRecursive(n) { | ||
function fibonacci(n) { | ||
if (n <= 1) return n; | ||
return fibonacciRecursive(n - 1) + fibonacciRecursive(n - 2); | ||
return fibonacci(n - 1) + fibonacci(n - 2); | ||
} | ||
bench('fibonacci(40)', () => fibonacciRecursive(40)); | ||
bench('fibonacci(40)', () => fibonacci(40)); | ||
@@ -45,3 +53,34 @@ boxplot(() => { | ||
``` | ||
</td> | ||
<td> | ||
```cpp | ||
#include "src/mitata.hpp" | ||
int fibonacci(int n) { | ||
if (n <= 1) return n; | ||
return fibonacci(n - 1) + fibonacci(n - 2); | ||
} | ||
int main() { | ||
mitata::runner runner; | ||
runner.bench("noop", []() { }); | ||
runner.summary([&]() { | ||
runner.bench("empty fn", []() { }); | ||
runner.bench("fibonacci", []() { fibonacci(20); }); | ||
}); | ||
auto stats = runner.run(); | ||
} | ||
``` | ||
</td> | ||
</tr> | ||
</table> | ||
## configure your experience | ||
@@ -55,2 +94,5 @@ | ||
await run({ throw: true }); // will immediately throw instead of handling error quietly | ||
// c++ | ||
auto stats = runner.run({ .colors = true, .format = "mitata", .filter = std::regex(".*") }); | ||
``` | ||
@@ -176,2 +218,10 @@ | ||
```cpp | ||
#include "src/mitata.hpp" | ||
int main() { | ||
auto stats = mitata::lib::fn([]() { /***/ }) | ||
} | ||
``` | ||
```js | ||
@@ -178,0 +228,0 @@ import { B, measure } from 'mitata'; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90711
8
331