Jump to content

Determine process latency

Recommended Posts

Hello all,

In Windows 7, you can use the Resource Monitor's Network tab to find the latency of any process that is using the network.

I would like to gather that information.

Is there a way that anyone knows of to access whatever the Resource Monitor is using to pull that information?

Even if I have to check latency myself, what method does the Resource Monitor use to learn the round trip time of the data?

Thanks for any help.

Edited by koresho
Link to post
Share on other sites

There might be something along those lines in Ascend4nt's Performance Counters in Windows - Measure CPU,Disk,Network etc Performance. Your gonna have to do some reading though as there is a lot of counters.

Link to post
Share on other sites
  • 3 weeks later...

So, I've not had a chance to come back to this project until now, and after looking through Ascend4nt's UDF (which is very thorough!) I seem to be missing the one thing I'm after: The latency of a process.

Maybe I'm simply overlooking it; if so I apologize for wasting anyone's time- however I've looked through all the supplied examples and don't see anything, even in the supplied "TestPDH_PerformanceCounters.au3" which seems to be an overview of all the functions that the UDF supports.

If anyone has any ideas, or a way that I can use Ascend4nt's code as a base and extend it, I'd appreciate the help.


Figured out a workaround. If someone has something to add, feel free- but here's what I did, in case people search for this in the future like I did. Basically, I scraped the Windows 7 Resource Monitor for the data.

Note: This only works on Windows 7 for sure, still testing for Vista.

Func _getStats() ;get the stats of the process latency
If TimerDiff($time) < GUICtrlRead($refreshRate) Then Return
If ProcessExists("process.exe") = 0 Then ;if the process doesn't exist, report it
  _update("Process isn't running!")
  Return ;return to the main loop
  $hWnd = ControlGetHandle ("Resource Monitor", "", "[CLASS:SysListView32; INSTANCE:15]" ); to get handle of listview
  $itemCount = _GUICtrlListView_GetItemCount($hWnd)
  For $i = 0 To $itemCount
   $text[$i] = _GUICtrlListView_GetItemText($hWnd, $i); Loop to get the contents of the list view
;~   _log($text[$i])
   If StringInStr($text[$i], "Process.exe") Then
    $ping = _GUICtrlListView_GetItemText($hWnd, $i, 6) ;get latency column
    If $ping = "-" Then
     _update("Connection idle")
     _log($text[$i] & " " & $ping)
     _update("Process.exe: " & $ping& "ms (Averaged)")
;at end
$time = TimerInit()

Func _startUpPerfmon()
If WinExists("Resource Monitor") = 0 Then
  FileInstall(".Default.ResmonCfg", @TempDir & "Default.ResmonCfg", 1)
  ShellExecute(@TempDir & "Default.ResmonCfg", "", "", "open", @SW_HIDE)
  WinWaitActive("Resource Monitor") ;just launching caused the window to lose focus, this gives it back
Edited by koresho
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...