Click here to Skip to main content
15,892,161 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Does performance reduces if i use always Public Sub or Sub instead of Private Sub? Pin
N a v a n e e t h30-Jun-08 21:02
N a v a n e e t h30-Jun-08 21:02 
AnswerRe: Does performance reduces if i use always Public Sub or Sub instead of Private Sub? Pin
~Khatri Mitesh~30-Jun-08 21:34
~Khatri Mitesh~30-Jun-08 21:34 
QuestionHelp reg .ini file in vb 6.0 Pin
aaraaayen30-Jun-08 19:58
aaraaayen30-Jun-08 19:58 
AnswerRe: Help reg .ini file in vb 6.0 Pin
ChandraRam1-Jul-08 0:26
ChandraRam1-Jul-08 0:26 
AnswerRe: Help reg .ini file in vb 6.0 Pin
jzonthemtn1-Jul-08 4:57
jzonthemtn1-Jul-08 4:57 
QuestionRead Outlook Attachment Pin
RCoate30-Jun-08 16:33
RCoate30-Jun-08 16:33 
QuestionHalf a solution Pin
RCoate30-Jun-08 19:33
RCoate30-Jun-08 19:33 
QuestionInstant CPU Utilization Value Pin
NeilPrice30-Jun-08 11:40
NeilPrice30-Jun-08 11:40 
Does anyone know if there's a painless way to get an instantaneous reading for CPU Utilization? I realise I can use a PerformanceCounter to call .RawValue but I have no idea how to convert that to anything that means anything. I don't want to have to take 2 values (ie. using .NextValue or .NextSample on the performance counter) as I know how to do this (see the example code below)

Dim myCounter As System.Diagnostics.PerformanceCounter = New _
System.Diagnostics.PerformanceCounter()

myCounter.CategoryName = "Processor"
myCounter.CounterName = "% Processor Time"
myCounter.InstanceName = "_Total"

Console.WriteLine(myCounter.NextValue().ToString())
System.Threading.Thread.Sleep(1000)
Console.WriteLine(myCounter.NextValue().ToString())


I realize that the CPU utilization value is a sampled value and *not* an instantaneous one but I'm thinking there must be a way to query whatever value Task Manager currently has - but I can't see a way of doing that?

(If you're wondering, I have a time critical app that I'd like to record a timestamp with current CPU Utilization in a log - the value doesn't have to be perfect but having a value is better than not having one.)

Thanks!
AnswerRe: Instant CPU Utilization Value Pin
Thomas Stockwell30-Jun-08 11:56
professionalThomas Stockwell30-Jun-08 11:56 
GeneralRe: Instant CPU Utilization Value Pin
NeilPrice1-Jul-08 4:38
NeilPrice1-Jul-08 4:38 
QuestionTimer Question Pin
DCAUB30-Jun-08 10:13
DCAUB30-Jun-08 10:13 
AnswerRe: Timer Question Pin
Luc Pattyn30-Jun-08 10:41
sitebuilderLuc Pattyn30-Jun-08 10:41 
GeneralRe: Timer Question Pin
DCAUB30-Jun-08 12:26
DCAUB30-Jun-08 12:26 
GeneralRe: Timer Question Pin
Luc Pattyn30-Jun-08 12:35
sitebuilderLuc Pattyn30-Jun-08 12:35 
GeneralRe: Timer Question Pin
DCAUB30-Jun-08 20:19
DCAUB30-Jun-08 20:19 
QuestionC++ Controls in VB? Pin
Saul Johnson30-Jun-08 8:19
Saul Johnson30-Jun-08 8:19 
AnswerRe: C++ Controls in VB? Pin
Kenny McKee30-Jun-08 8:59
Kenny McKee30-Jun-08 8:59 
QuestionMenuStrip control searching by menue name Pin
Georg Kohler30-Jun-08 8:06
Georg Kohler30-Jun-08 8:06 
AnswerRe: MenuStrip control searching by menue name Pin
Thomas Stockwell30-Jun-08 11:12
professionalThomas Stockwell30-Jun-08 11:12 
GeneralRe: MenuStrip control searching by menue name Pin
Georg Kohler30-Jun-08 11:38
Georg Kohler30-Jun-08 11:38 
GeneralRe: MenuStrip control searching by menue name Pin
Thomas Stockwell30-Jun-08 11:51
professionalThomas Stockwell30-Jun-08 11:51 
AnswerRe: MenuStrip control searching by menue name Pin
Scott Dorman30-Jun-08 15:58
professionalScott Dorman30-Jun-08 15:58 
GeneralRe: MenuStrip control searching by menue name Pin
Georg Kohler30-Jun-08 16:13
Georg Kohler30-Jun-08 16:13 
GeneralRe: MenuStrip control searching by menue name Pin
Scott Dorman30-Jun-08 18:08
professionalScott Dorman30-Jun-08 18:08 
GeneralRe: MenuStrip control searching by menue name Pin
Georg Kohler30-Jun-08 21:38
Georg Kohler30-Jun-08 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.