I have a below code in which I get `start` value from the `timestamp` that is being passed to `getUser` method. And also I get `end` value from the `current timestamp` in milliseconds.

Minimum value for `start` can be `0` and maximum value for `end` can be `13` I guess. So my below for loop will work fine if `start` is always less than `end`.

```
bool getUser(uint64_t timestamp) {

    uint64_t start = (timestamp / (60 * 60 * 1000 * 24))  % 14;

    struct timeval tp;
    gettimeofday(&tp, NULL);
    uint64_t ms = tp.tv_sec * 1000 + tp.tv_usec / 1000; //get current timestamp in milliseconds

    uint64_t end = (ms / (60 * 60 * 1000 * 24))  % 14;

    for (uint64_t i = start; i<=end; i++) {

    }
}

```

But it is also possible at some point, that `start` can be greater than `end`. Meaning suppose, `start` value is `9` and `end` value is `2`, then my above for loop won't work as in this case, I want to iterate my for loop from `9 to 2` which will be `i = 9, 10, 11, 12, 13, 0, 1, 2`.

How to make sure if `start` is less than `end` and `start` is greater than `end` then my above for loop works fine in both the scenarios..

My above for loop works fine if start is less than end but it will not work for `start` greate than `end`