One more 64-bit to 32-bit conversion

This commit is contained in:
Dominic Hamon 2015-02-18 22:21:39 -08:00
parent 55285fd2ae
commit 2789aba1ce
2 changed files with 3 additions and 4 deletions

View File

@ -25,7 +25,7 @@ void SleepForSeconds(double seconds) {
SleepForMilliseconds(static_cast<int>(kNumMillisPerSecond * seconds));
}
#else // OS_WINDOWS
void SleepForMicroseconds(int64_t microseconds) {
void SleepForMicroseconds(int microseconds) {
struct timespec sleep_time;
sleep_time.tv_sec = microseconds / kNumMicrosPerSecond;
sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro;
@ -34,11 +34,11 @@ void SleepForMicroseconds(int64_t microseconds) {
}
void SleepForMilliseconds(int milliseconds) {
SleepForMicroseconds(static_cast<int64_t>(milliseconds) * kNumMicrosPerMilli);
SleepForMicroseconds(static_cast<int>(milliseconds) * kNumMicrosPerMilli);
}
void SleepForSeconds(double seconds) {
SleepForMicroseconds(static_cast<int64_t>(seconds * kNumMicrosPerSecond));
SleepForMicroseconds(static_cast<int>(seconds * kNumMicrosPerSecond));
}
#endif // OS_WINDOWS
} // end namespace benchmark

View File

@ -10,7 +10,6 @@ const int64_t kNumMicrosPerSecond = kNumMillisPerSecond * 1000LL;
const int64_t kNumNanosPerMicro = 1000LL;
const int64_t kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
void SleepForMicroseconds(int64_t microseconds);
void SleepForMilliseconds(int milliseconds);
void SleepForSeconds(double seconds);
} // end namespace benchmark