-
Notifications
You must be signed in to change notification settings - Fork 1
/
BenchmarkProperties.ts
41 lines (36 loc) · 1.05 KB
/
BenchmarkProperties.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* User changeable properties of a Benchmark
*/
export class BenchmarkProperties {
/**
* The minimum number of cycle runs
*/
readonly minCycles: number = 10;
/**
* The maximum number of cycle runs.
* The algorithm always tries to run the maximum number of runs
*/
readonly maxCycles: number = 100;
/**
* The maximum time a test can run, in seconds.
* Note that minCycles has priority over this setting.
*/
readonly maxTime: number = 15;
/**
* The Benchmark name
*/
readonly name: string = undefined;
/**
* BenchmarkProperties constructor
*
* @param properties the new properties
*/
constructor(properties: object) {
//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];
}
}