Name of benchmark.
Times of benchmark result.
Times of benchmark result in milliseconds.
Name of this test.
Average time of this benchmark in milliseconds.
Guessed error range of this benchmark.
Error range per average time.
The time of fastest test in milliseconds.
Operations per seconds.
Standard error of the mean of times.
The time of slowest test in milliseconds.
Standard division of times.
Total milliseconds of this benchmark.
Time unbiased sample variance of times.
Assertion if it taked more (or less) time than expected.
Expected rule format is {operator}{number}{unit}
; use like <=10msec
.
Operator and unit are can omit. If omitted, uses <=
and msec
.
This function will throw AsyncMarkAssertionError if result is unaccepcable.
Expected time in milliseconds number or string value.
e.g. <10ms
or >=20s
.
example | means |
---|---|
"<42" | faster than 42 msec |
"<=42" or omit | 42 msec or faster |
">42" | slower than 42 msec |
">=42" | 42 msec or slower |
example | means |
---|---|
"42s" or "42sec" | seconds |
"42ms" or "42msec" | milliseconds |
"42us" or "42usec" | microseconds |
"42ns" or "42nsec" | nanoseconds |
const result = await Benchmark(function() {
# do something that expect done in least 100msec
}).run();
result.assert(100);
const result = await Benchmark(async function() {
await sleep_function(100);
}).run();
result.assert('>90ms', '<110ms');
Convert to string for printing.
Human redable string
Generated using TypeDoc
The result of benchmark.
This value will included outlier. Please use Result.dropOutlier if you want drop they.