How long does it take for a substance to leave the body?
The half-life of a drug, or the time it takes for half of the drug to be metabolized and eliminated from the body, depends on many variables. Published half-life data is usually determined by measuring the decrease in parent drug in serum or plasma. In the anti-doping world, the serum half-life is of limited value in determining how long a substance stays in the body because it does not reflect the presence of metabolites (break-down products from the parent drug).
Athletes are strictly responsible for what is found in their body at the time of a drug test. Understanding clearance times of medications, which is the time it takes for the medication, and its metabolites, to be completely eliminated from the body, becomes essential.
Read more here