Technique of measuring the amount of time or other resources used by different components of an executing computer program