diff options
author | Madhanraj Chelladurai <mchellad@codeaurora.org> | 2016-03-15 09:39:05 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-31 10:25:22 -0700 |
commit | c4c29c3ca72053ac22727972a7ae9191ea78f47c (patch) | |
tree | dd94937479243af5374156ea459993a7165c642d /utils/LocTimer.cpp | |
parent | 7908e789747f32f18b4dbcc1e9b4e56bc6d4423f (diff) | |
download | gps-c4c29c3ca72053ac22727972a7ae9191ea78f47c.tar.gz |
gps: consider nsec while ranking the timer objects
We need to consider nsec as well while ranking timer objects
Change-Id: Ieaad5dfa80b26b90e998618b3cbe1e590fc00839
CRs-Fixed: 991345
Diffstat (limited to 'utils/LocTimer.cpp')
-rw-r--r-- | utils/LocTimer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/LocTimer.cpp b/utils/LocTimer.cpp index 70904b2..4de6b40 100644 --- a/utils/LocTimer.cpp +++ b/utils/LocTimer.cpp @@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); if (timer) { // larger time ranks lower!!! - // IOW, if input obj has bigger tv_sec, this obj outRanks higher + // IOW, if input obj has bigger tv_sec/tv_nsec, this obj outRanks higher rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + if(0 == rank) + { + //rank against tv_nsec for msec accuracy + rank = (int)(timer->mFutureTime.tv_nsec - mFutureTime.tv_nsec); + } } return rank; } |