DataCollection.StopProfile (Método)

El método StopProfile establece el contador en 0 (desactivado) para el nivel de generación de perfiles especificado.

Espacio de nombres:  Microsoft.VisualStudio.Profiler
Ensamblado:  Microsoft.VisualStudio.Profiler (en Microsoft.VisualStudio.Profiler.dll)

Sintaxis

'Declaración
Public Shared Function StopProfile ( _
    profileLevel As ProfileLevel, _
    elementId As UInteger _
) As ProfileOperationResult
public static ProfileOperationResult StopProfile(
    ProfileLevel profileLevel,
    uint elementId
)
public:
static ProfileOperationResult StopProfile(
    ProfileLevel profileLevel, 
    unsigned int elementId
)
static member StopProfile : 
        profileLevel:ProfileLevel * 
        elementId:uint32 -> ProfileOperationResult 
public static function StopProfile(
    profileLevel : ProfileLevel, 
    elementId : uint
) : ProfileOperationResult

Parámetros

  • elementId
    Tipo: System.UInt32
    Identificador del proceso o del subproceso generado por el sistema.

Valor devuelto

Tipo: Microsoft.VisualStudio.Profiler.ProfileOperationResult
El valor devuelto, ProfileOperationResult, es una enumeración.

Comentarios

StartProfile y StopProfile controlan el estado de Start/Stop del nivel de generación de perfiles.El valor inicial predeterminado de Start/Stop es 1.El valor inicial se puede cambiar en el Registro.Cada llamada a StartProfile establece el estado de Start/Stop en 1; cada llamada a StopProfile lo establece en 0.

Cuando el valor del contador Start/Stop es mayor que 0, el estado de Start/Stop del nivel es ON.Cuando es menor o igual que 0, el estado de Start/Stop es OFF.

Cuando los estados de Start/Stop y de Suspend/Resume son ON, el estado de generación de perfiles del nivel es ON.Para que se generen los perfiles de un subproceso los estados del subproceso en todos los niveles (global, de proceso y de subproceso) deben ser ON.

Ejemplos

En el siguiente ejemplo se ilustra el método StopProfile.En el ejemplo se asume que se ha realizado una llamada al método StartProfile para el mismo subproceso o proceso identificado por DataCollection.CurrentId.

        public void ExerciseStopProfile()
        {
            // StartProfile and StopProfile control the 
            // Start/Stop state for the profiling level. 
            // The default initial value of Start/Stop is 1. 
            // The initial value can be changed in the registry. 
            // Each call to StartProfile sets Start/Stop to 1; 
            // each call to StopProfile sets it to 0. 

            // Declare enumeration to hold result of call 
            // to StopProfile.
            ProfileOperationResult profileResult;

            profileResult = DataCollection.StopProfile(
                ProfileLevel.Global,
                DataCollection.CurrentId);

            Console.WriteLine("StopProfile returned {0}", profileResult);
        }

Seguridad de .NET Framework

Vea también

Referencia

DataCollection Clase

Microsoft.VisualStudio.Profiler (Espacio de nombres)