Which is better upper_bound or find function?

Hi,
To find if a number is present , which fucntion is better,
upper_bound or find function.

upper_bound will work only if the array is sorted. And its complexity is O(log n)
find function does not require the array to be sorted. Its complexity is O(n)
So if array is sorted, use upper_bound else find function