Commit 5e77de62 by Eric

Merge pull request #76 from google/64-32

One more 64-bit to 32-bit conversion
parents 11488610 2789aba1
......@@ -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
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment