From 7dfdcf12cf1ed271dab92723eb2856094625fbb8 Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Sat, 10 Oct 2015 17:57:44 +0800 Subject: [PATCH] fix the calculation in SleepForMilliseconds static_cast should be done after the multiplication operation. --- src/sleep.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sleep.cc b/src/sleep.cc index cc6409723f..11f08d44fd 100644 --- a/src/sleep.cc +++ b/src/sleep.cc @@ -40,7 +40,7 @@ void SleepForMicroseconds(int microseconds) { } void SleepForMilliseconds(int milliseconds) { - SleepForMicroseconds(static_cast(milliseconds) * kNumMicrosPerMilli); + SleepForMicroseconds(static_cast(milliseconds * kNumMicrosPerMilli)); } void SleepForSeconds(double seconds) {