Udostępnij za pośrednictwem


Metoda DataCollection.StopProfile —

Metoda StopProfile ustawia licznik 0 (wyłączone) dla określonego poziomu profilowania.

Przestrzeń nazw:  Microsoft.VisualStudio.Profiler
Zestaw:  Microsoft.VisualStudio.Profiler (w Microsoft.VisualStudio.Profiler.dll)

Składnia

'Deklaracja
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

Parametry

  • elementId
    Typ: System.UInt32
    Identyfikator procesu lub wątku generowane przez system.

Wartość zwracana

Typ: Microsoft.VisualStudio.Profiler.ProfileOperationResult
Wartość zwracana, ProfileOperationResult, jest wyliczeniem.

Uwagi

StartProfile i StopProfile kontroli stanu uruchomienia i zatrzymania dla poziomu profilowania.Domyślna wartość początkowego uruchomienia i zatrzymania wynosi 1.W rejestrze można zmienić wartość początkową.Każde wywołanie StartProfile ustawia uruchomienia i zatrzymania na 1; Każde wywołanie StopProfile ustawia ją na 0.

Kiedy Uruchom/Zatrzymaj jest większa niż 0, stan uruchomienia i zatrzymania dla poziomu jest włączone.Gdy jest mniejsza niż lub równa 0, stan uruchomienia i zatrzymania jest wyłączona.

Gdy stan uruchomienia i zatrzymania i stan wstrzymania/Wznowienie są zarówno na, stan profilowania dla poziomu jest włączone.Dla wątku za profilowane, globalne, proces i wątek poziomu Państwa dla wątku, musi być na.

Przykłady

Poniższy przykład ilustruje metodę StopProfile.W przykładzie założono, że dokonano wywołanie metody StartProfile dla tego samego wątku lub procesu identyfikowanego przez 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);
        }

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DataCollection Klasa

Przestrzeń nazw Microsoft.VisualStudio.Profiler