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?
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.
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.