but I don't know whether my time complexity is O(log n)

```
class Solution {
public int[] searchRange(int[] nums, int target) {
int l = 0, r = nums.length - 1;
int[] res = {-1, -1};
while(l <= r){
int mid = (l + r)/2;
if(nums[mid] == target){
int i = mid , j = mid;
while(i >= 1 && nums[i - 1] == target) i--;
res[0] = i;
while(j <= nums.length - 2 && nums[j + 1] == target) j++;
res[1] = j;
return res;
}
else if(nums[mid] < target) l = mid + 1;
else r = mid - 1;
}
return res;
}
}
```