diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-03-17 20:16:42 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-17 20:16:42 -0700 |
commit | 6ed6f6d82d7b9f8d82f3ab3a9f718a0e59ffa476 (patch) | |
tree | 4376f402d02d4fea5371ccebb11d78e44171af2b /include/utils | |
parent | 315f19be8ef26fee77db2455f8c2997680755f6d (diff) | |
parent | aa3855d5836d2a2d83baafdf6e40caf90d3dad1c (diff) | |
download | frameworks_base-6ed6f6d82d7b9f8d82f3ab3a9f718a0e59ffa476.zip frameworks_base-6ed6f6d82d7b9f8d82f3ab3a9f718a0e59ffa476.tar.gz frameworks_base-6ed6f6d82d7b9f8d82f3ab3a9f718a0e59ffa476.tar.bz2 |
Merge "Refactor how timeouts are calculated."
Diffstat (limited to 'include/utils')
-rw-r--r-- | include/utils/Timers.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/utils/Timers.h b/include/utils/Timers.h index 9a9e07c..8b4d322 100644 --- a/include/utils/Timers.h +++ b/include/utils/Timers.h @@ -88,6 +88,16 @@ nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); nsecs_t systemTime(int clock); #endif // def __cplusplus +/** + * Returns the number of milliseconds to wait between the reference time and the timeout time. + * If the timeout is in the past relative to the reference time, returns 0. + * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, + * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. + * Otherwise, returns the difference between the reference time and timeout time + * rounded up to the next millisecond. + */ +int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); + #ifdef __cplusplus } // extern "C" #endif |