TimeoutRemainder
public
class
TimeoutRemainder
extends Object
| java.lang.Object
|
| ↳ |
com.android.tradefed.device.server.TimeoutRemainder
|
Utility class to keep track of how much time is left given an initial timeout. This is useful
when a method receives a timeout parameter and needs to perform multiple operations within that
given timeout.
Note: The implementation keeps track of time using System.nanoTime() units, meaning
this class is not suitable for timeouts longer than ~290 years.
Summary
Nested classes |
class |
TimeoutRemainder.DefaultSystemNanoTime
|
interface |
TimeoutRemainder.SystemNanoTimeProvider
|
Public constructors
TimeoutRemainder
public TimeoutRemainder (TimeoutRemainder.SystemNanoTimeProvider nanoTimeProvider,
long timeout,
TimeUnit unit)
| Parameters |
nanoTimeProvider |
TimeoutRemainder.SystemNanoTimeProvider |
timeout |
long |
unit |
TimeUnit |
TimeoutRemainder
public TimeoutRemainder (long timeout,
TimeUnit unit)
| Parameters |
timeout |
long |
unit |
TimeUnit |
Public methods
getRemainingNanos
public long getRemainingNanos ()
getRemainingUnits
public long getRemainingUnits (TimeUnit unit)
getRemainingUnits
public long getRemainingUnits ()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-12-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-04 UTC."],[],[]]