本文整理匯總了VB.NET中System.Diagnostics.PerformanceCounter.NextSample方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET PerformanceCounter.NextSample方法的具體用法?VB.NET PerformanceCounter.NextSample怎麽用?VB.NET PerformanceCounter.NextSample使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Diagnostics.PerformanceCounter
的用法示例。
在下文中一共展示了PerformanceCounter.NextSample方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: CollectSamples
Private Shared Sub CollectSamples(ByVal samplesList As ArrayList)
Dim r As New Random(DateTime.Now.Millisecond)
' Loop for the samples.
Dim j As Integer
For j = 0 To 99
Dim value As Integer = r.Next(1, 10)
Console.Write(j.ToString() + " = " + value.ToString())
avgCounter64Sample.IncrementBy(value)
avgCounter64SampleBase.Increment()
If j Mod 10 = 9 Then
OutputSample(avgCounter64Sample.NextSample())
samplesList.Add(avgCounter64Sample.NextSample())
Else
Console.WriteLine()
End If
System.Threading.Thread.Sleep(50)
Next j
End Sub