Causes the currently executing thread to sleep (temporarily cease execution) for the specified
number of milliseconds as specified in Thread#sleep(long).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class MockSleeper (2.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0 (latest)](/java/docs/reference/google-http-client/latest/com.google.api.client.testing.util.MockSleeper)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.testing.util.MockSleeper)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.testing.util.MockSleeper)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.testing.util.MockSleeper)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.testing.util.MockSleeper)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.testing.util.MockSleeper)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.testing.util.MockSleeper)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.testing.util.MockSleeper) \n\n public class MockSleeper implements Sleeper\n\n[Beta](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta) \n\nMock for [Sleeper](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Sleeper).\n\nImplementation is not thread-safe. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e MockSleeper \n\nImplements\n----------\n\n[Sleeper](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Sleeper) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### MockSleeper()\n\n public MockSleeper()\n\nMethods\n-------\n\n### getCount()\n\n public final int getCount()\n\nReturns the number of times [#sleep(long)](/java/docs/reference/google-http-client/latest/com.google.api.client.testing.util.MockSleeper#com_google_api_client_testing_util_MockSleeper_sleep_long_) was called.\n\n### getLastMillis()\n\n public final long getLastMillis()\n\nReturns the value of `millis` parameter when [#sleep(long)](/java/docs/reference/google-http-client/latest/com.google.api.client.testing.util.MockSleeper#com_google_api_client_testing_util_MockSleeper_sleep_long_) was last called or\n`0` if not called.\n\n### sleep(long millis)\n\n public void sleep(long millis)\n\nCauses the currently executing thread to sleep (temporarily cease execution) for the specified\nnumber of milliseconds as specified in Thread#sleep(long)."]]