That's one way to look at it, yes.
But I think more commonly we say that problem P is O(f) if there exists an algorithm deciding P that runs in time O(f).