2

Is there any metric for responsiveness of a WinForms/Windows application?

Something like the percentage of time the message loop is blocked for?

How can it be obtained?

pnuts
  • 58,317
  • 11
  • 87
  • 139
chillitom
  • 24,888
  • 17
  • 83
  • 118

2 Answers2

1

A large number of the SendMessage() calls that deliver a message straight to the window procedure are in Windows or another process. Can't time those. An indirect measurement could be SetTimer() and measuring how late the WM_TIMER message gets delivered.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

How about setting a timer event to run e.g. 10x per second, checking each time the event fires the elapsed time since the last time, and keeping a tally of how often this time exceeds 250ms, 500ms, 750ms, etc. up to a maximum of "10 seconds or more"? From a user perspective, it doesn't matter if the message loop is blocked 90% of the time if it's never blocked for more than 10ms. On the other hand, if the message loop is blocked for 15 seconds at a time once every five minutes, many users would deem that grossly unacceptable even though the loop is only blocked 5% of the time overall.

supercat
  • 77,689
  • 9
  • 166
  • 211