Udostępnij za pośrednictwem


Metoda DataCollection.MarkProfile —

Metoda MarkProfile wstawia znacznik profil w pliku .vsp.Profilowanie dla wątku, zawierającą funkcję MarkProfile musi być na znak ma zostać wstawiony.

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

Składnia

'Deklaracja
Public Shared Function MarkProfile ( _
    markId As Integer _
) As MarkOperationResult
public static MarkOperationResult MarkProfile(
    int markId
)
public:
static MarkOperationResult MarkProfile(
    int markId
)
static member MarkProfile : 
        markId:int -> MarkOperationResult 
public static function MarkProfile(
    markId : int
) : MarkOperationResult

Parametry

  • markId
    Typ: System.Int32
    Wstaw znacznik.Znacznik musi być większa lub równa 0 (zero).

Wartość zwracana

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

Uwagi

Wartość znaku jest wstawiany do pliku .vsp każdym razem, gdy kod jest uruchamiany, jeśli jest są także wyprofilowane wątku, zawierającą funkcję MarkProfile.MarkProfile można wywołać wiele razy.

Profil znaki są globalne w zakresie.Na przykład znak profilu, dodaje się w jednym wątku można oznaczyć początek lub koniec segmentu danych w dowolnym wątku w pliku .vsp.

Stan profilowania dla wątku, który zawiera funkcję profilu znak musi być gdy znaczniki i komentarze wstawiane za pomocą polecenia znak lub z funkcji API (CommentMarkAtProfile, CommentMarkProfile lub MarkProfile).

Ważna uwagaWażne

MarkProfile metody należy używać z Instrumentacji tylko.

Przykłady

Poniższy przykład ilustruje metodę MarkProfile.

        public void ExerciseMarkProfile()
        {
            // Declare and initialize variables to pass to 
            // MarkProfile.  The values of these parameters 
            // are assigned based on the needs of the code;
            // and for the sake of simplicity in this example, 
            // the variables are assigned arbitrary values.
            int markId = 03;

            // Declare enumeration to hold return value of 
            // call to MarkProfile.
            MarkOperationResult markResult;

            markResult = DataCollection.MarkProfile(
                markId);

            Console.WriteLine("MarkProfile returned {0}", markResult);
        }

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DataCollection Klasa

Przestrzeń nazw Microsoft.VisualStudio.Profiler