Compares two timestamps where either can be in seconds or milliseconds. @param ts1 The first timestamp in either seconds or milliseconds. @param ts2 The second timestamp in either seconds or milliseconds. @return Whether the first timestamp is after the second
(long ts1, long ts2)
| 648 | * @return Whether the first timestamp is after the second |
| 649 | */ |
| 650 | public static boolean isTimestampAfter(long ts1, long ts2) { |
| 651 | boolean ts1InSeconds = (ts1 & Const.SECOND_MASK) == 0; |
| 652 | boolean ts2InSeconds = (ts2 & Const.SECOND_MASK) == 0; |
| 653 | |
| 654 | if (ts1InSeconds && !ts2InSeconds) { |
| 655 | ts1 *= 1000L; |
| 656 | } else if (!ts1InSeconds && ts2InSeconds) { |
| 657 | ts2 *= 1000L; |
| 658 | } |
| 659 | |
| 660 | return ts1 > ts2; |
| 661 | } |
| 662 | } |
no outgoing calls