Fix precision when measuring vsock host to VM data transfer rate
This CL addresses the warning in aosp/2189600.
Bug: 236123069
Test: atest MicrodroidBenchmarks
Change-Id: I0e54d4177160c27e94c6c49a8548a5ddd6826bd0
diff --git a/tests/benchmark/src/jni/io_vsock_host_jni.cpp b/tests/benchmark/src/jni/io_vsock_host_jni.cpp
index 7f3d655..dd32e29 100644
--- a/tests/benchmark/src/jni/io_vsock_host_jni.cpp
+++ b/tests/benchmark/src/jni/io_vsock_host_jni.cpp
@@ -36,7 +36,7 @@
clock_t end = clock();
double elapsed_seconds = (double)(end - start) / CLOCKS_PER_SEC;
LOG(INFO) << "Host:Finished sending data in " << elapsed_seconds << " seconds.";
- double send_rate = num_bytes_to_send / kNumBytesPerMB / elapsed_seconds;
+ double send_rate = (double)num_bytes_to_send / kNumBytesPerMB / elapsed_seconds;
return {send_rate};
}