From 76fca221347339e210ba3a24d2739d8dd147c15c Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 9 Dec 2016 15:12:24 -0800 Subject: Use a more accurate timer to sleep on Linux systems. --- unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h index 090e7a835..f92e39d69 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h @@ -53,8 +53,10 @@ #if EIGEN_OS_WIN || EIGEN_OS_WIN64 #define EIGEN_SLEEP(n) Sleep(n) +#elif EIGEN_OS_GNULINUX +#define EIGEN_SLEEP(n) usleep(n * 1000); #else -#define EIGEN_SLEEP(n) sleep(n*1000) +#define EIGEN_SLEEP(n) sleep(std::max(1, n/1000)) #endif #endif -- cgit v1.2.3