MCPcopy Create free account
hub / github.com/Proryanator/encoder-benchmark / run

Method run

engine/src/benchmark_engine.rs:26–52  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

24 }
25
26 pub fn run(&mut self) {
27 let runtime = SystemTime::now();
28 let ctrl_channel = setup_ctrl_channel();
29
30 let mut calc_time: Option<Duration> = None;
31 for i in 0..self.permutations.clone().len() {
32 let permutation_start_time = SystemTime::now();
33 let permutation = self.permutations[i].clone();
34 // benchmark will not log ETA since every encode will be different
35 log_benchmark_header(i, &self.permutations, calc_time);
36 self.results
37 .push(run_encode(permutation.clone(), &ctrl_channel));
38 calc_time = Option::from(permutation_start_time.elapsed().unwrap());
39 }
40
41 // produce output files and other logging here
42 let runtime_str = format_dhms(runtime.elapsed().unwrap().as_secs());
43 log_results_to_file(
44 self.results.clone(),
45 &runtime_str,
46 Vec::new(),
47 self.permutations[0].bitrate,
48 true,
49 &self.log_files_directory,
50 );
51 println!("Benchmark runtime: {}", runtime_str);
52 }
53
54 pub fn add(&mut self, permutation: Permutation) {
55 self.permutations.push(permutation);

Callers 2

benchmarkFunction · 0.45
mainFunction · 0.45

Calls 4

setup_ctrl_channelFunction · 0.85
log_benchmark_headerFunction · 0.85
run_encodeFunction · 0.85
log_results_to_fileFunction · 0.85

Tested by

no test coverage detected