aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-09 15:12:24 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-09 15:12:24 -0800
commit76fca221347339e210ba3a24d2739d8dd147c15c (patch)
tree982267b515d3465d8771b6759ec4b4070241e982 /unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h
parent4deafd35b75cde9c9d40360a37c364594fd8161a (diff)
Use a more accurate timer to sleep on Linux systems.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h4
1 files changed, 3 insertions, 1 deletions
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<unsigned>(1, n/1000))
#endif
#endif