System.Profile (gb)

Static Property Profile As Boolean

Return or set if profiling at instruction level is enabled.

That property does nothing if the program is not run with profiling mode enabled.