diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-05-25 14:42:20 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-05-25 14:42:20 -0700 |
commit | 8e5799ed16ab605d8de775e1644f1fa59ff6627e (patch) | |
tree | cc7f1fd4b865123a2ee50ddebd628004e186112f /include | |
parent | 7d0fb57044576fd4bbaf9683997bab288c3b759c (diff) | |
parent | af685f3bb566f297deee1615d55d4f33d5580ba3 (diff) | |
download | frameworks_base-8e5799ed16ab605d8de775e1644f1fa59ff6627e.zip frameworks_base-8e5799ed16ab605d8de775e1644f1fa59ff6627e.tar.gz frameworks_base-8e5799ed16ab605d8de775e1644f1fa59ff6627e.tar.bz2 |
am af685f3b: am 85a7f99c: Merge "Refactor how timeouts are calculated. (DO NOT MERGE)" into honeycomb-mr2
* commit 'af685f3bb566f297deee1615d55d4f33d5580ba3':
Refactor how timeouts are calculated. (DO NOT MERGE)
Diffstat (limited to 'include')
-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 |