Skip to content

Commit fc011f3

Browse files
committed
Modify BenchmarkRunner.lf
1 parent c7c791a commit fc011f3

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

TS/Savina/src/BenchmarkRunner.lf

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,31 @@ reactor BenchmarkRunner(numIterations:number(12)) {
2525

2626

2727
reaction(startup) -> nextIteration {=
28-
measuredTimes.length = numIterations;
28+
// measuredTimes.length = numIterations;
2929
actions.nextIteration.schedule(0, true);
3030

3131
console.log("Benchmark will run " + numIterations + " times \n");
3232
console.log("System information:")
3333
console.log(`Platform: ${process.platform} \n`)
3434
=}
35-
3635

37-
reaction(nextIteration) -> start, done {=
38-
if (count < numIterations) {
39-
startTime = util.getCurrentPhysicalTime();
40-
start = true;
41-
} else {
42-
actions.done.schedule(0, true);
43-
}
36+
reaction(nextIteration) -> start {=
37+
startTime = util.getCurrentPhysicalTime();
38+
start = true;
4439
=}
4540

46-
reaction(finish) -> nextIteration {=
41+
reaction(finish) -> nextIteration, done {=
4742
const duration = util.getCurrentPhysicalTime().subtract(startTime as TimeValue);
48-
measuredTimes[count] = duration.toMilliseconds();
43+
measuredTimes.push(duration.toMilliseconds());
4944
++count;
5045

5146
console.log("Iteration "+ count + " - " + duration.toMilliseconds() + " ms\n");
5247

53-
actions.nextIteration.schedule(0, true);
54-
48+
if (count < numIterations) {
49+
actions.nextIteration.schedule(0, true);
50+
} else {
51+
actions.done.schedule(0, true);
52+
}
5553
=}
5654

5755
reaction(done) {=

0 commit comments

Comments
 (0)