Hi

At the moment I use gettickcount to time how long it takes for code to execute. Then I realised that this measure is only a guide rather than an accurate measure as it can be influenced by the total number of applications open at the same time. For example if I time my code execution while I do not have any other applications open it is much faster than if it is executed while I have 20 other applications open that are all simultaneously and actively using processor time.

Is there a way to determine the amount of processing time that was used to just execute my code (not other applications executing simultaneously)?