Time Limit Exceeded

Can someone tell me that when a submission is showing TLE does it mean that the code is giving the desired output but taking too much time? or does it mean it is just taking too much time irrespective of the code being right or wrong?

It means it is taking too much time irrespective of the code being right.