Aracılığıyla paylaş


DataCollection.SuspendProfile Yöntem

SuspendProfile yöntemi, belirtilen profil oluşturma düzeyi için askıya alma/devam et sayacı artırır.

Ad alanı:  Microsoft.VisualStudio.Profiler
Derleme:  Microsoft.VisualStudio.Profiler (Microsoft.VisualStudio.Profiler.dll içinde)

Sözdizimi

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

Parametreler

  • elementId
    Tür: System.UInt32
    Sistem tarafından oluşturulan işlem veya iş parçacığı tanımlayıcısı.

Dönüş Değeri

Tür: Microsoft.VisualStudio.Profiler.ProfileOperationResult
Dönüş değeri, ProfileOperationResult, enum ' dir.

Notlar

SuspendProfile ve ResumeProfile askıya alma/devam et sayaç için profil oluşturma düzeyini kontrol eder.Askıya alma/devam et sayaç genellikle standart profiler API veri denetim işlevlerini geçersiz kılmak için kullanılır.

Askıya alma/devam et sayaç başlangıç değeri 0'dır.SuspendProfile her çağrı için askıya alma/devam etme sayısı 1 ekler; ResumeProfile her çağrı 1 çıkarır.

Askıya alma/devam etme sayısı 0'dan büyük olduğunda düzeyi için askıya alma/devam etme durumu Kapalı'dır.Bu sayı sıfıra eşit veya daha az olduğunda, askıya alma/devam et durumuna açık'tır.

Başlat/Durdur durumu ve askıya alma/devam et durumuna her ikisi de etkin durumdayken, düzeyi için profil oluşturma durumu açık'tır.Bir iş parçacığı olması, global, proses ve profili iş parçacığı düzeyini belirten iş parçacığı için tüm olmalıdır on.

Örnekler

Aşağıdaki örnekte, SuspendProfile yöntemi gösterilmektedir.Bu örnek, StartProfile önceki bir çağrı için DataCollection.CurrentId özelliği tarafından tanımlanan iş parçacığı ve işlem yapılan varsayar.

        public void ExerciseSuspendProfile()
        {
            // 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. 
                        
            // Declare enumeration to hold result of call 
            // to SuspendProfile
            ProfileOperationResult profileResult;

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

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

DataCollection Sınıf

Microsoft.VisualStudio.Profiler Ad Alanı