kruonis
Version:
A tool to perform benchmarks on TS
41 lines (40 loc) • 1.24 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BenchmarkProperties = void 0;
/**
* User changeable properties of a Benchmark
*/
class BenchmarkProperties {
/**
* BenchmarkProperties constructor
*
* @param properties the new properties
*/
constructor(properties) {
/**
* The minimum number of cycle runs
*/
this.minCycles = 10;
/**
* The maximum number of cycle runs.
* The algorithm always tries to run the maximum number of runs
*/
this.maxCycles = 100;
/**
* The maximum time a test can run, in seconds.
* Note that minCycles has priority over this setting.
*/
this.maxTime = 15;
/**
* The Benchmark name
*/
this.name = undefined;
//If properties is an object
if (properties === Object(properties))
for (let property_name of Object.keys(properties))
// Only update properties that exist
if (this.hasOwnProperty(property_name))
this[property_name] = properties[property_name];
}
}
exports.BenchmarkProperties = BenchmarkProperties;
;