1313 */
1414
1515target Rust {
16- build-type: MinSizeRel ,
16+ build-type: Release ,
1717 cargo-features: ["cli"],
18- cargo-dependencies: {
19- cpu-time: "1",
20- },
2118};
2219
2320import BenchmarkRunner from "../lib/BenchmarkRunner.lf";
@@ -26,8 +23,6 @@ reactor ProducerReactor(count_to: u32(1000000)) {
2623 state i: u32(0); // current counter value
2724 state count_to(count_to);
2825
29- state start: ProcessTime({=ProcessTime::now()=});
30-
3126 input inStartCounting: unit;
3227 output outFinishedCounting: unit;
3328
@@ -38,10 +33,6 @@ reactor ProducerReactor(count_to: u32(1000000)) {
3833
3934 logical action count: unit;
4035
41- preamble {=
42- use cpu_time::ProcessTime;
43- =}
44-
4536 reaction(inStartCounting) -> count, outResetCounter {=
4637 // reset counter
4738 self.i = 0;
@@ -76,9 +67,9 @@ reactor CountingReactor {
7667 input inIncrement: unit;
7768 input inRetrieveResult: unit;
7869 output outSendResult: u32;
79-
70+
8071 state count: u32(0);
81-
72+
8273 reaction(inReset) {=
8374 self.count = 0;
8475 =}
@@ -94,13 +85,13 @@ reactor CountingReactor {
9485main reactor (num_iterations: usize(12), count_to: u32(1000000)) {
9586 state num_iterations(num_iterations);
9687 state count_to(count_to);
97-
88+
9889 producer = new ProducerReactor(count_to = count_to);
9990 runner = new BenchmarkRunner(num_iterations=num_iterations);
100-
91+
10192 runner.start -> producer.inStartCounting;
10293 producer.outFinishedCounting -> runner.finished;
103-
94+
10495 reaction(startup) {=
10596 print_benchmark_info("CountingBenchmark");
10697 print_args!(
@@ -111,14 +102,14 @@ main reactor (num_iterations: usize(12), count_to: u32(1000000)) {
111102 );
112103 print_system_info();
113104 =}
114-
105+
115106 counter = new CountingReactor();
116-
107+
117108 producer.outIncrement -> counter.inIncrement;
118109 producer.outResetCounter -> counter.inReset;
119110 producer.outRetrieveResult -> counter.inRetrieveResult;
120111 counter.outSendResult -> producer.inResult;
121-
112+
122113 preamble {=
123114 use crate::{print_args,reactors::benchmark_runner::{print_system_info, print_benchmark_info}};
124115 =}
0 commit comments