diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h
index 24d829a..a922826 100644
--- a/lib/cpp/test/concurrency/TimerManagerTests.h
+++ b/lib/cpp/test/concurrency/TimerManagerTests.h
@@ -36,7 +36,7 @@
 public:
   class Task : public Runnable {
   public:
-    Task(Monitor& monitor, int64_t timeout)
+    Task(Monitor& monitor, uint64_t timeout)
       : _timeout(timeout),
         _startTime(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count()),
         _endTime(0),
@@ -72,7 +72,7 @@
    * properly clean up itself and the remaining orphaned timeout task when the
    * manager goes out of scope and its destructor is called.
    */
-  bool test00(int64_t timeout = 1000LL) {
+  bool test00(uint64_t timeout = 1000LL) {
 
     shared_ptr<TimerManagerTests::Task> orphanTask
         = shared_ptr<TimerManagerTests::Task>(new TimerManagerTests::Task(_monitor, 10 * timeout));
@@ -94,7 +94,7 @@
         Synchronized s(_monitor);
         timerManager.add(orphanTask, 10 * timeout);
 
-        THRIFT_SLEEP_USEC(timeout * 1000);
+        std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
 
         task.reset(new TimerManagerTests::Task(_monitor, timeout));
         timerManager.add(task, timeout);
@@ -122,7 +122,7 @@
    * verifies that the timer manager properly clean up itself and the remaining orphaned timeout
    * task when the manager goes out of scope and its destructor is called.
    */
-  bool test01(int64_t timeout = 1000LL) {
+  bool test01(uint64_t timeout = 1000LL) {
     TimerManager timerManager;
     timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
     timerManager.start();
@@ -155,7 +155,7 @@
    * clean up itself and the remaining orphaned timeout task when the manager goes out of scope
    * and its destructor is called.
    */
-  bool test02(int64_t timeout = 1000LL) {
+  bool test02(uint64_t timeout = 1000LL) {
     TimerManager timerManager;
     timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
     timerManager.start();
@@ -188,7 +188,7 @@
    * verifies that the timer manager properly clean up itself and the remaining orphaned timeout
    * task when the manager goes out of scope and its destructor is called.
    */
-  bool test03(int64_t timeout = 1000LL) {
+  bool test03(uint64_t timeout = 1000LL) {
     TimerManager timerManager;
     timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
     timerManager.start();
@@ -225,7 +225,7 @@
   /**
    * This test creates one tasks, and tries to remove it after it has expired.
    */
-  bool test04(int64_t timeout = 1000LL) {
+  bool test04(uint64_t timeout = 1000LL) {
     TimerManager timerManager;
     timerManager.threadFactory(shared_ptr<ThreadFactory>(new ThreadFactory()));
     timerManager.start();
