I know how J. S. Mill defines happiness and unhappiness. This criterion is based primarily on consequences so that the goal is to maximize the number of happy people of those affected by the action. But what if a person gets immediate unhappiness at first but consequently resulting in most happiness afterwards? should that person result be evaluated as happiness? How should it be treated if the result is mixed?
Mill would, I think, say that yes, we must account both the immediate unhappiness and the subsequent happiness in our calculations.
Bear in mind that Mill has a way of balancing pleasures and assessing which is better, i.e. more desirable - those who have experienced both vote on which is better/higher. This means that pleasures, even if not quantifiable, are nonetheless comparable.
Moreover, one can (and really must) address both the immediate unhappiness and the subsequent happiness as separate in calculating the best outcome - these are both outcomes of the same action, and no action is so simple that it has only good or only bad outcomes. Every outcome of every action is always mixed, so a utilitarian calculus really must be able to deal with mixed situations, and Mill's can. The key is to separate the good from the bad and value each individually, then weigh them against one another.
So, when someone's best happiness is achieved through momentary initial suffering, Mill would very simply weigh the likely initial suffering against the likely subsequent happiness, and if the happiness accreted over time is of a greater magnitude than the unhappiness in the immediate term, it is, on balance, a good thing to do.