mirror of
https://github.com/google/benchmark.git
synced 2025-01-30 05:40:15 +08:00
One more 64-bit to 32-bit conversion
This commit is contained in:
parent
55285fd2ae
commit
2789aba1ce
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user