Udostępnij za pośrednictwem


Metoda DataCollection.ResumeProfile —

Licznik ResumeProfile Dekrementuje metoda Wstrzymaj/Wznów 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 ResumeProfile ( _
    profileLevel As ProfileLevel, _
    elementId As UInteger _
) As ProfileOperationResult
public static ProfileOperationResult ResumeProfile(
    ProfileLevel profileLevel,
    uint elementId
)
public:
static ProfileOperationResult ResumeProfile(
    ProfileLevel profileLevel, 
    unsigned int elementId
)
static member ResumeProfile : 
        profileLevel:ProfileLevel * 
        elementId:uint32 -> ProfileOperationResult
public static function ResumeProfile(
    profileLevel : ProfileLevel, 
    elementId : uint
) : ProfileOperationResult

Parametry

  • elementId
    Typ: UInt32

    Identyfikator procesu lub wątku generowany przez system.

Wartość zwracana

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

Uwagi

Początkowa wartość licznika Wstrzymaj/Wznów to 0.Każde wywołanie SuspendProfile dodaje 1 do licznika Wstrzymaj/Wznów; każde wywołanie ResumeProfile odejmuje od niego 1.

Gdy licznik Wstrzymaj/Wznów jest większy niż 0, stan Wstrzymaj/Wznów dla poziomu jest wyłączony.Kiedy licznik jest mniejszy lub równy 0, stan Wstrzymaj/Wznów jest włączony.

Gdy zarówno stan Start/Stop i stan Wstrzymaj/Wznów są włączone, stan profilowania dla poziomu to ON.Dla profilowanego wątku, wszystkie stany wątku: globalny, procesu i poziomu wątku muszą być włączone.

Przykłady

Poniższy przykład ilustruje metodę ResumeProfile.W przykładzie założono, że wykonano wywołanie metody SuspendProfile dla samego wątku lub proces zidentyfikowany przez DataCollection.CurrentId.

        void ExerciseResumeProfile()
        {
            // The initial value of the Suspend/Resume counter is 0. 
            // Each call to SuspendProfile adds 1 to the Suspend/Resume 
            // count; each call to ResumeProfile subtracts 1. 

            // Variables used to print output.
            HRESULT hResult;
            TCHAR tchBuffer[256];

            // Declare enumeration to hold result of call to ResumeProfile
            PROFILE_COMMAND_STATUS profileResult;

            profileResult = ResumeProfile(
                PROFILE_GLOBALLEVEL,
                PROFILE_CURRENTID);

            // Format and print result.
            LPCTSTR pszFormat = TEXT("%s %d.\0");
            TCHAR* pszTxt = TEXT("ResumeProfile returned");
            hResult = StringCchPrintf(tchBuffer, 256, pszFormat, 
                pszTxt, profileResult);
            }

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DataCollection Klasa

Przestrzeń nazw Microsoft.VisualStudio.Profiler