Преглед изворни кода

test-harness: change wasm benchmark to use microsecs instead of millisecs

zero пре 2 година
родитељ
комит
99d5e54883
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/contract/test-harness/src/lib.rs

+ 3 - 3
src/contract/test-harness/src/lib.rs

@@ -303,15 +303,15 @@ fn benchmark_wasm_calls(
         let mut times = [0; 3];
         let mut times = [0; 3];
         let now = std::time::Instant::now();
         let now = std::time::Instant::now();
         let _metadata = runtime.metadata(&payload).expect("metadata");
         let _metadata = runtime.metadata(&payload).expect("metadata");
-        times[0] = now.elapsed().as_millis();
+        times[0] = now.elapsed().as_micros();
 
 
         let now = std::time::Instant::now();
         let now = std::time::Instant::now();
         let update = runtime.exec(&payload).expect("exec");
         let update = runtime.exec(&payload).expect("exec");
-        times[1] = now.elapsed().as_millis();
+        times[1] = now.elapsed().as_micros();
 
 
         let now = std::time::Instant::now();
         let now = std::time::Instant::now();
         runtime.apply(&update).expect("update");
         runtime.apply(&update).expect("update");
-        times[2] = now.elapsed().as_millis();
+        times[2] = now.elapsed().as_micros();
 
 
         writeln!(
         writeln!(
             file,
             file,