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
This commit is contained in:
Madhanraj Chelladurai 2016-03-15 09:39:05 +05:30
parent 02cad4d981
commit 14f0dc1b52

View file

@ -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;
}