Assume that a given turing machine $M$ accepts words in the language in $n^k$ or less steps, but words that aren't in the language are rejected in unknown number of steps (the machine might even loop).
$k$ is unknown.
Is $L(M)\in P$?
Well, obviously $L(M)$ is recognized in polynomial time. The question is whether it's possible to decide $L(M)$ in polynomial time.
It seems to me that the answer is no, but I can't figure a way to prove it.