How to detect when running within profiler?

Is it possible for the code to detect that it is running from within the profiler? I have certain areas of my code which have to be modified in order to work with the profiler, but which I do not want to leave as production changes.

Comments

  • Hi,

    If you are just interested in if ANTS is profiling then you could check if the following environment variables are set:

    cor_profiler
    cor_enable_profiling


    Regards,
    Dene.
    Dene Boulton
    Red Gate
Sign In or Register to comment.